-
Notifications
You must be signed in to change notification settings - Fork 280
VSD - constant expression evaluation speedup #6290
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
VSD - constant expression evaluation speedup #6290
Conversation
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.
Looks good so far. A test case would be good.
cfde5e3
to
9b7f4ff
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6290 +/- ##
========================================
Coverage 75.96% 75.96%
========================================
Files 1508 1508
Lines 163282 163292 +10
========================================
+ Hits 124040 124052 +12
+ Misses 39242 39240 -2
Continue to review full report at Codecov.
|
9b7f4ff
to
25b91df
Compare
25b91df
to
c037f34
Compare
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.
Great; thank you!
-- | ||
This expression is derived from a real system under test. Due to inadvertent reevaluation of expression operands, all expression evaluations had geometric complexity (even more so in the presence of TOP values). This particular expression took nearly two hours to evaluate. Reworking to prevent repeated reevaluation brings this down to a few tenths. | ||
See https://github.com/diffblue/cbmc/pull/6290 | ||
If this test appears to hang, the constant_evaluator is probably your first port of call. |
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.
❤️
This PR reduces the number of times the operands in a constant_value expression are reevaluated. Usually, this overhead is small but for nested expressions this can result in excessive runtimes.
The motivating example has the form
This doesn't look particularly difficult, but evaluation time for the goto-program in question was close to two hours. With these changes evaluation time is approximately two tenths of a second (usual caveats - as reported by
time
on my machine, etc).