-
Notifications
You must be signed in to change notification settings - Fork 13
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
perf: visit less clauses during propagation #66
perf: visit less clauses during propagation #66
Conversation
Here are the benchmark results compared to the main branch: This is a clear improvement. @jjerphan You might be interested in this one! |
Hi @baszalmstra and @wolfv, At first sight, the performance improvements are quite significant. I am definitely interested in having a look at this and at other ones. I need to find some proper time to review it. On a side note, I would like to implement an ILP formulation of the problem (as first highlighted by @DerThorsten): this offers theoretical consistency but might not offer tractability in practice. I wrote a few notes about it. |
ba5b415
to
838bf88
Compare
/// Constructs a new [`Literal`] from a [`InternalSolvableId`] and a boolean | ||
/// indicating whether the literal should be negated. | ||
pub fn new(solvable_id: InternalSolvableId, negate: bool) -> Self { | ||
assert!(solvable_id.0 < (u32::MAX >> 1) - 1, "solvable id too big"); |
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.
Could / should this be a debug assert? I assume we're not constructing so many literals on the fly anymore, so perhaps this is fine?
@@ -1078,41 +1126,43 @@ impl<D: DependencyProvider, RT: AsyncRuntime> Solver<D, RT> { | |||
) -> Result<u32, Conflict> { | |||
{ | |||
tracing::info!( | |||
"├─ Propagation conflicted: could not set {solvable} to {attempted_value}", | |||
"├┬ Propagation conflicted: could not set {solvable} to {attempted_value}", |
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 is such beautiful ascii pipes.
This branch adds several optimizations. From large impact to small they are: