-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Evaluation] [Performance] Tweak 'safeIndexOne' #6663
[Evaluation] [Performance] Tweak 'safeIndexOne' #6663
Conversation
3d50fe5
to
1ec7b16
Compare
1ec7b16
to
b5a6534
Compare
/benchmark validation |
This reverts commit b5a6534.
Click here to check the status of your benchmark. |
/benchmark validation |
Comparing benchmark results of 'validation' on 'c082e28591' (base) and '1448b2a7c8' (PR) Results table
|
/benchmark nofib |
1 similar comment
/benchmark nofib |
/benchmark lists |
1 similar comment
/benchmark lists |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on 'c082e28591' (base) and '1448b2a7c8' (PR) Results table
|
/benchmark nofib |
Click here to check the status of your benchmark. |
/benchmark lists |
/benchmark validation |
1 similar comment
/benchmark validation |
Comparing benchmark results of 'nofib' on '223cca3c6f' (base) and 'e939f7dcb5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'lists' on '223cca3c6f' (base) and 'e939f7dcb5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on '223cca3c6f' (base) and 'e939f7dcb5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on '223cca3c6f' (base) and 'e939f7dcb5' (PR) Results table
|
Well, seems like making it worker-wrapper-friendly allowed us to claw a few more percent out of cold GHC hands. Pretty great! |
safeIndexOneCont z f = findTree where | ||
findTree :: RAList a -> Word64 -> b | ||
-- See Note [Optimizations of safeIndexOneCont]. | ||
findTree Nil !_ = z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you need to bang the wildcard here: findTree Nil !_
(amazing results btw)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the referenced Note:
Bangs in the local definitions of 'safeIndexOneCont' are needed to tell GHC that the functions are
strict in the 'Word64' argument, so that GHC produces workers operating on @Word64#@.
Otherwise GHC doesn't know that it can unbox the second argument.
Env.safeIndexOneCont | ||
(throwingWithCause _MachineError OpenTermEvaluatedMachineError . Just $ Var () varName) | ||
pure | ||
varEnv | ||
(coerce varIx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it matters, but place this change also on the SteppableCek (for trying to keep the code similar :D )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thank you.
There is a criterion benchmark inside index-envs if you want to use it. I will try to run it myself to see the before and after numbers |
I personally don't really care. The CEK machine is significantly faster and that's enough for me. |
Just being curious.