Skip to content

Use std::forward_list instead of std::map in irept by default [blocks: #3486] #4458

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

Merged
merged 2 commits into from
May 28, 2019

Conversation

tautschnig
Copy link
Collaborator

This reduces the size of an irept by 5 pointers (i.e., 40 bytes on
64-bit systems).

Also make typet constructor compatible with the STL shipped with GCC 5.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig added Needs data This PR claims improvements that require further data to substantiate the claims. blocker labels Mar 29, 2019
@tautschnig tautschnig self-assigned this Mar 29, 2019
@kroening
Copy link
Member

Can you split? The constructor seems obvious and trivial, whereas the change to list will require us to do a lot of consulting & benchmarking.

@tautschnig
Copy link
Collaborator Author

@kroening The constructor change is now in #4460.

@tautschnig tautschnig changed the title Use std::forward_list instead of std::map in irept by default Use std::forward_list instead of std::map in irept by default [depends-on: #4460] Mar 30, 2019
@tautschnig
Copy link
Collaborator Author

Just for the record: on ReachSafety-ECA with this change we can perform 3819.81 symex_step calls per second, compared to 2752.28 calls per second with develop. I'll now try to figure out what exactly makes so much of a difference.

@tautschnig
Copy link
Collaborator Author

It seems that just about any irept-related operation is cheaper (creating fresh irepts of course, but also irept::operator==).

@tautschnig tautschnig marked this pull request as ready for review March 30, 2019 10:56
@tautschnig tautschnig added dependent - do not merge and removed Needs data This PR claims improvements that require further data to substantiate the claims. labels Mar 30, 2019
tautschnig added a commit that referenced this pull request Mar 30, 2019
Ensure typet constructor is always compatible with GCC 5's STL [blocks: #4458]
@tautschnig tautschnig assigned kroening and unassigned tautschnig Mar 30, 2019
@tautschnig tautschnig changed the title Use std::forward_list instead of std::map in irept by default [depends-on: #4460] Use std::forward_list instead of std::map in irept by default [blocks: #3486] Mar 30, 2019
@tautschnig tautschnig force-pushed the forward-list branch 2 times, most recently from 512e9c9 to d0f270e Compare March 30, 2019 15:58
@danpoe
Copy link
Contributor

danpoe commented May 9, 2019

On a set of methods from Apache Tika, symex was overall 21% faster with the changes in this PR (20.8s vs 26.4s).

@smowton
Copy link
Contributor

smowton commented May 9, 2019

On my large Webgoat run I find running time is practically identical, but the memory usage is down around 30%.

@martin-cs
Copy link
Collaborator

martin-cs commented May 9, 2019 via email

@romainbrenguier
Copy link
Contributor

Here are the results on my benchmark:
chart (3)
overall forward lists were about 10% faster

@martin-cs
Copy link
Collaborator

That's starting to look quite convincing isn't it?

@tautschnig
Copy link
Collaborator Author

No known regressions (including external feedback), just needs final approval from at least one of @chrisr-diffblue @forejtv @peterschrammel @thk123.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 754dbfc).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112051965
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: cfcc7e8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112097093
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

irep.h provides std::map if, and only if, NAMED_SUB_IS_FORWARD_LIST is
not set.

Also cleanup include guards (pushing them to be the outermost
preprocessor directives) and indentation of includes.
This reduces the size of an irept by 5 pointers (i.e., 40 bytes on
64-bit systems). On SV-COMP's ReachSafety-ECA with this change we can
perform 3819.81 symex_step calls per second, compared to 2752.28 calls
per second with the std::map configuration. The performance improvements
are spread across various `irept`-related operations.
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 2b9849a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/112365181
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.