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 evalGlobal performance problem #624

Closed
brianhuffman opened this issue Jan 10, 2020 · 2 comments
Closed

Saw-core evalGlobal performance problem #624

brianhuffman opened this issue Jan 10, 2020 · 2 comments
Assignees
Labels
performance Issues that involve or include performance problems
Milestone

Comments

@brianhuffman
Copy link
Contributor

Profiling shows that in the saw-core backends, the function evalGlobal'.global in module Verifier.SAW.Simulator is called way too many times. Each call requires a lookup in a map keyed by the Ident of the global. It should only be called at most once per global constant; the unique term ids should cache the result of each lookup after that. However, profiling shows that we are doing millions of map lookups, and the cost adds up.

@brianhuffman brianhuffman added the performance Issues that involve or include performance problems label Jan 11, 2020
@robdockins robdockins added this to the 0.7 milestone Oct 16, 2020
@robdockins robdockins self-assigned this Oct 16, 2020
@brianhuffman
Copy link
Contributor Author

I think the problem is caused by the fact that definition bodies of constants defined in the saw-core prelude are not constructed as shared terms; they use the Unshared constructor instead. We could improve the performance either by doing hash consing and term sharing while importing the saw-core prelude, or by doing a name resolution pass over the ASTs.

@atomb atomb modified the milestones: 0.7, 0.8 Dec 14, 2020
@atomb atomb modified the milestones: 0.8, 0.9 Apr 19, 2021
@brianhuffman
Copy link
Contributor Author

I believe that this problem no longer occurs; as of GaloisInc/saw-core#118 we are now producing shared terms from definitions in the saw-core prelude, which are now represented as Constant terms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues that involve or include performance problems
Projects
None yet
Development

No branches or pull requests

3 participants