perf: cache candidates seperate from their sorting#251
perf: cache candidates seperate from their sorting#251baszalmstra merged 7 commits intoconda:mainfrom
Conversation
|
|
|
Can you explain why AHashMap is faster? I looked at the crate briefly but it wasn't obvious to me why there would be a performance improvement. Everything else looks great! |
|
One other thing I noticed (and maybe that's related) is the order of the packages printed to-be-installed became non-deterministic. I am not sure that it's what we want. We might even want the opposite and order the matchspecs initially to get results independent of spec-ordering. |
I think it should be left up to the user to determine how they want to sort the packages. Given that it is now (especially with your changes) relatively easy to generate a topological sort from the result I say we leave this as is.
Yeah, I also find it not very user friendly that |
|
The thing is that the order of evaluation of the packages influences the result (e.g. when you ask for If I understood the AHashMap correctly, then it uses a source of randomness for the hashing. I guess I am wondering if that source of randomness could alter the resolutions. |
As far as I know, the only place we use this HashMap is to lookup keys to values. I don't think we are iterating over the hashmaps anywhere which could indeed cause that behavior. Do you see different results on every run?
That was already the case right? Or does this PR change that? |
|
The order of prints is already different every time in main. So let's forget about it for now. |
|
I merge after the tests are done! |
Improve performance of the solver by caching the candidates separately from the sorted candidates. The candidates were also computed to compare different solvables.
With these improvements libsolv-rs beats the C impl in every case. (on my machine..)