-
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
Z3 inefficient isTrue implementation #357
Comments
…son. Z3 uses internal formula hashing, thus there should not be multiple pointers to the same boolean constants. This reduces the number of JNI calls for some simple cases.
Thanks for your comment. |
Yeah, for the common use-case you won't notice much of a difference. |
… comparison. Z3 uses internal formula hashing, thus there should not be multiple pointers to the same boolean constants. This reduces the number of JNI calls for some simple cases.
…son. Z3 uses internal formula hashing, thus there should not be multiple pointers to the same boolean constants. This reduces the number of JNI calls for some simple cases.
Z3's implementation of
isTrue
iswhich in turn does at least 3 native calls.
Wouldn't it suffice to do the following?
Maybe there is a possibility to have multiple copies of the true value?
The reason that I'm asking is that the first implementation is considerably slower and it is very noticable when tracking the solver with the user propagators from #349. Indeed, on an Nqueens + propagator example, 1/3 (70 seconds!) of all time is spent just executing the
isTrue
function. The proposed solution is faster by at least two orders of magnitude.I can fix this bottleneck directly in the user propagator (by just not using
isTrue
) but I would rather have a solution that benefits everyone (considering thatisTrue
/isFalse
is called internally in many places).The text was updated successfully, but these errors were encountered: