Giter Club home page Giter Club logo

Comments (5)

Bodigrim avatar Bodigrim commented on June 1, 2024

benchLoop f x n
| n == 0 = pure ()
| otherwise = do
_ <- evaluate (frc (f x))
benchLoop f x (n - 1)

@AndreasPK I'm sorry, I don't quite follow, what exactly can SpecConstr specialise here?

Would passing GHC.Exts.SPEC help?

from tasty-bench.

Bodigrim avatar Bodigrim commented on June 1, 2024

I checked Core of bytestring benchmarks.

benchIndices_$s$wbenchLoop2
  :: ByteString -> Word64# -> State# RealWorld -> State# RealWorld
benchIndices_$s$wbenchLoop2
  = \ (x_s3Me :: ByteString)
      (ww_s3Mh :: Word64#)
      (eta_s3Mj :: State# RealWorld) ->
      case ww_s3Mh of wild_X1 {
        __DEFAULT ->
          case seq#
                 (case x_s3Me of { BS ww1_s3NJ ww2_s3NK ww3_s3NL ->
                  case $weta1 ww1_s3NJ ww2_s3NK ww3_s3NL of wild2_i3hw {
                    Nothing -> Nothing;
                    Just x1_i3hx -> case x1_i3hx of { I# ipv_i3hc -> wild2_i3hw }
                  }
                  })
                 eta_s3Mj
          of
          { (# ipv_i3sR, ipv1_i3sS #) ->
          benchIndices_$s$wbenchLoop2
            x_s3Me (subWord64# wild_X1 1##64) ipv_i3sR
          };
        0##64 -> eta_s3Mj
      }
end

AFAIU the effect of specialization is that the function has been specialized to inline instance NFData (Maybe a). I think it's a good effect: indeed we'd rather have less overhead caused by benchLoop.

from tasty-bench.

Bodigrim avatar Bodigrim commented on June 1, 2024

@AndreasPK what do you think about 9c86990? It seems to resolve the issue for bytestring: now everything is as specialized as possible.

from tasty-bench.

AndreasPK avatar AndreasPK commented on June 1, 2024

@AndreasPK what do you think about 9c86990? It seems to resolve the issue for bytestring: now everything is as specialized as possible.

Using SPEC isn't something I had considered but should work. I that's the only way tasty-bench runs into the SpecConstr issue that's probably good enough.

from tasty-bench.

Bodigrim avatar Bodigrim commented on June 1, 2024

Thanks for the report and for the analysis, @AndreasPK! I'll merge 9c86990 then.

from tasty-bench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.