Completed a TODO on barrier free SkipList::Insert() and cleaned some unused headers#1309
Open
FlavioMili wants to merge 1 commit intogoogle:mainfrom
Open
Completed a TODO on barrier free SkipList::Insert() and cleaned some unused headers#1309FlavioMili wants to merge 1 commit intogoogle:mainfrom
FlavioMili wants to merge 1 commit intogoogle:mainfrom
Conversation
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.
I tested the change using perf on previous main version and my branch
From the results I got a consistent improvement of up to 10% on the
Insert()function.I needed to add a second function because the other option I had was to use templates with two functions anyway and to me it looked harder to read for a newcomer or maintainer.
There was also the option to add a ternary operator inside the loop but it ended up having no improvement at all, or even being slightly worse.
Environment
Performance Comparison (micros/op)
I would still take these with a grain of salt, some results are too close to be compared in my opinion
| Benchmark | Baseline (Old) | Optimized (New) |
| :--- | :---: | :---: | :---: |
| fillrandom | 1.789 | 1.745 |
| overwrite | 2.474 | 2.419 |
| fill100K | 418753 | 416100 |
| fillsync | 3.591 | 3.570 |
| readrandom | 5.338 | 5.235 |
| readseq | 0.182 | 0.183 |