-
Notifications
You must be signed in to change notification settings - Fork 44
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
Df/caching termlike hashes #3338
Conversation
|
This re-creates the one |
|
2e495a1
to
7316801
Compare
|
699ae15
to
82e7c64
Compare
|
/KEVM-perf-run |
Cache the hash of the `TermLikeF` in the `TermLike`, and extract it in the `Hashable` instance instead of recursing into the `TermLikeF`. The precomputed hash in produced using the derived `Hashable` instance of `TermLikeF`, which will call `hash` on the respective sub-structure (like `And`, `Or`, ...), wrapped into one of the `TermLikeF` constructors. For all such sub-structures, the derived `Hashable` instance will then recurse into the contents (containing a `TermLike` again for the case of `TermLike`), thereby using the cached hashes directly instead of performing a deep recursion. Partially addresses #3113
Write a specialized from :: TermLike Concrete -> TermLike variable I was hoping this would remove a number of the new `Hashable` constraints; unfortunately it was not so successful in that regard. It did, however remove quite a lot of `InternalVariable` constraints, so I guess that's a win.
`fourmolu` support for CPP is experimental, limited, and basically buggy. It's apparently okay to make whole top-level declarations conditional, so let's do it that way.
82e7c64
to
1e6ae6c
Compare
/KEVM-perf-run |
The KEVM test suggests I lack adequate permissions. |
|
That's a gotcha in the github settings - you need to be publicly a member of the RV organosation, i.e. make your membership publicly visible. |
/KEVM-perf-run |
Running KEVM test with 1e6ae6c and K version as https://github.com/runtimeverification/haskell-backend/actions/runs/3466091969 |
Running test with 1e6ae6c and kevm-bug-storagevar03-with-conditions.tar.gz as https://github.com/runtimeverification/haskell-backend/actions/runs/3466278670 |
KEVM test finished: https://github.com/runtimeverification/haskell-backend/actions/runs/3466091969 EDIT: pasting results here 🎉 looks like a consistent 10% speedup 🎉
|
Looks promising! It would be good to see what happens with the stricter versions. |
indeed...worth a try. These are the top consumers now (from the
|
@treeowl ^^^ we have an |
|
Aha, okay. I'll use that in the future. I was waiting for @ana-pantilie before pulling the lever on this one. |
Cache the hash of the TermLikeF in the TermLike, and extract it in the Hashable instance instead of recursing into the TermLikeF.
The precomputed hash in produced using the derived Hashable instance of TermLikeF, which will call hash on the respective sub-structure (like And, Or, ...), wrapped into one of the TermLikeF constructors. For all such sub-structures, the derived Hashable instance will then recurse into the contents (containing a TermLike again for the case of TermLike), thereby using the cached hashes directly instead of performing a deep recursion.
Partially addresses #3113
Fixes #nnnn
Scope:
Estimate:
Review checklist
The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.