-
Notifications
You must be signed in to change notification settings - Fork 36
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: keep directly the intersection of derivations in Memory #33
Comments
One thing I was wondering about is how this works with backtracking. If we backtrack to before a decision that introduced that derivation then does that mean that some terms need to come out of that intersection? If so how do we do that? Even if this is a problem, it is not insurmountable, we can keep the |
That's a very relevant question! Backtracking is currently operated thanks to Conflict resolution is not common I think in a normal setting since newer versions tend to be compatible with older ones, and we choose newer versions by default. Also, once we've found the root cause for a conflict, I don't see a reason we should have another conflict soon. It's probably worth having two things for memory derivations, a precomputed intersection, and terms that have not been intersected yet in a complementary vec. Something like this in the struct PackageAssignments<V: Version> {
decision: Option<(V, Term<V>)>,
derivations_intersected: Term,
derivations_not_intersected_yet: Vec<Term<V>>,
} The Slightly unrelated, but related performance-wise, I couldn't figure how to mutate in place the history and memory and so had to clone the whole history which is quite bad. Is this another case where interior mutability is needed? is there a better way to do that? |
|
I've had a try at this today. I chose
So on the |
And on
|
On my computer the improvements are similarly grate! I look forward to that getting polished into a PR! |
I was excited, so pushed a commit to your branch with some cleaned ups. If that was rude I am sorry and ignore the commit. |
ahah don't worry, I didn't even plan to make a PR of this soon. I used the commits for the two new benchmarks, which definitely shouldn't end in Git (we'll have to re-assess that git LFS situation, but that's another subject). I see that branch more as exploration stuff. Feel free to fill it with all the ideas and cleanup you want ^^ |
Done in #37 which is on its way to being merged. |
Memory stores a
Vec
of derivations per package. If we are to evaluate potential packages in a smarter way #32 , we need the intersection of derivation terms.There are two methods in
Memory
that can return iterators to individual assignment terms,terms_for_package
andpotential_packages
. The latter is the use case we are discussing for performance improvements in #32 . And the former is to compute relations in incompatibilities that eventually ends up computing the intersection of those terms. Considering that we seem to spend much time in relation computation #27 , this could be a non-negligible speedup.The text was updated successfully, but these errors were encountered: