Introduce Overflow & Displacement tracking.#517
Open
matthieu-m wants to merge 1 commit intorust-lang:masterfrom
Open
Introduce Overflow & Displacement tracking.#517matthieu-m wants to merge 1 commit intorust-lang:masterfrom
matthieu-m wants to merge 1 commit intorust-lang:masterfrom
Conversation
* Changes: - Introduce Overflow Trackers, with features to select the desired variant. - Introduce Displacements, conditional on the Overflow Tracker variant tracking removals. - Adjust insertion/removal of items in RawTable to properly track overflow and displacement. - Adjust find in RawTable to short-circuit probe sequence when overflow tracking ensure there is no need to probe further. - OF NOTE: enforce group alignment. * Motivation: Overflow tracking allows cutting a probing sequence short, which may be beneficial. The use of a multitude of variants makes it easier to test and benchmark all variants, thus making it easier to pick the right one... or not pick any. The groups are now forcibly aligned because overflow tracking is performed on a group basis, and does not work with "floating" groups. * Design: Overflow trackers and displacements are tacked at the end of the allocation, and their access is minimized, so that their performance impact is minimized. In particular: 1. An element which does not overflow on insertion need not trigger a write to any overflow tracker, nor to its displacement. 2. Only if removals are tracked is the displacement read on removal. 3. Only if removals are tracked and the displacement is non-0 are overflow trackers written to on removal. This follows the philosophy of "You Don't Pay For What You Don't Use", and makes the impact as minimal as can be.
Contributor
|
☔ The latest upstream changes (presumably #525) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Motivation:
Overflow tracking allows cutting a probing sequence short, which may be beneficial.
The use of a multitude of variants makes it easier to test and benchmark all variants, thus making it easier to pick the right one... or not pick any.
The groups are now forcibly aligned because overflow tracking is performed on a group basis, and does not work with "floating" groups.
Design:
Overflow trackers and displacements are tacked at the end of the allocation, and their access is minimized, so that their performance impact is minimized.
In particular:
This follows the philosophy of "You Don't Pay For What You Don't Use", and makes the impact as minimal as can be.
Benchmarks:
Methodology: each variant was benchmarked 3 times, and for each benchmark the best result was picked. Then all results were normalized on the current master for ease of comparison.
Remarks:
nonevariant is completely neutral, which means that enforcing group alignment did not affect performance.may_have_overflowedshould be inlined since it's expected to be rare.In any case, at least with the scaffolding in place it should be possible to experiment further if there's any will to.