Skip to content
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

Saw-core simulator speedups #1458

Merged
merged 3 commits into from
Sep 20, 2021
Merged

Saw-core simulator speedups #1458

merged 3 commits into from
Sep 20, 2021

Conversation

brianhuffman
Copy link
Contributor

This PR includes a couple of performance optimizations for the saw-core simulator backends:

  • Make saw-core simulator use separate IntMaps for open/closed subterms. This gives a significant speedup to mkMemoLocal, because memo table updates are done with insertions into a much smaller table.
  • Don't memoize subterms in function position in saw-core simulator. Memoizing such subterms doesn't actually save anything, because the memoized value is just a monadic thunk that runs the same simulator code each time it's called. This patch lets us avoid some of the IntMap insertion operations.

This partially addresses #1425.

@brianhuffman brianhuffman added the PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run label Sep 16, 2021
Brian Huffman added 2 commits September 17, 2021 15:00
This gives a significant speedup to mkMemoLocal, because memo table
updates are done with insertions into a much smaller table.
Memoizing such subterms doesn't actually save anything, because
the memoized value is just a monadic thunk that runs the same
simulator code each time it's called. This patch lets us avoid
some of the IntMap insertion operations.
@mergify mergify bot merged commit 997bfab into master Sep 20, 2021
@mergify mergify bot deleted the simulator-speedup branch September 20, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants