-
Notifications
You must be signed in to change notification settings - Fork 40
Use stable order for dependencies #377
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
base: dev
Are you sure you want to change the base?
Conversation
See #373 (comment). This test fails on 32-bit, where the iteration order of an `FxHashMap` is different: ``` $ cargo test -p pubgrub --test tests same_result_across_platforms --target i686-unknown-linux-gnu -q running 1 test same_result_across_platforms --- FAILED failures: ---- same_result_across_platforms stdout ---- thread 'same_result_across_platforms' panicked at tests/tests.rs:137:5: assertion `left == right` failed left: "964" right: "712" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: same_result_across_platforms test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.29s error: test failed, to rerun pass `-p pubgrub --test tests` ```
If we want to use some else than `FxHashMap` internally at some point.
CodSpeed Performance ReportMerging #377 will degrade performances by 25.64%Comparing Summary
Benchmarks breakdown
|
|
I’d really love to have @Eh2406 point of view on this, especially performance-wise. Because all data structure changes in the lib have potential to significantly degrades performances. |
|
Overall having control over our types is a huge improvement. For |
|
I haven't checked, but I assume the sudoku perf regression is due to the changed traversal order, we call get dependencies a max of 999 and realistically much less, I don't see how this could have that much of an impact. |
Fixes #373.
By using a
Vecinstead of an[Fx]HashMapforDependencyConstraints, the insertion order of dependencies becomes deterministic, and thereby our internal prioritization. This fixes the problem in #373 where priorities, and thereby resolutions, can change depending on the platform, such as 64-bit vs 32-bit. Now, the first package in a dependency list is always prioritized.As
DependencyConstraintshad exposed theFxHashMap, this is breaking change that requires pubgrub v0.4.I made
SelectedDependenciesopaque too for good measure.