-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Based on #22] Less inline directives, more bench determinism #24
Open
HadrienG2
wants to merge
16
commits into
TimelyDataflow:master
Choose a base branch
from
HadrienG2:less-inline
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
HadrienG2
commented
Sep 20, 2019
@@ -40,7 +39,7 @@ fn _bench_enc<T: Abomonation>(bencher: &mut Bencher, record: T) { | |||
bencher.bytes = bytes.len() as u64; | |||
bencher.iter(|| { | |||
bytes.clear(); | |||
unsafe { encode(&record, &mut bytes).unwrap(); } | |||
unsafe { encode(&record, &mut bytes).unwrap() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scarily enough, a semicolon is all it takes to defeat Bencher's hidden black_box
mechanism.
This was referenced Sep 20, 2019
HadrienG2
force-pushed
the
less-inline
branch
2 times, most recently
from
September 26, 2019 05:56
6b17c64
to
f06515e
Compare
HadrienG2
force-pushed
the
less-inline
branch
from
September 26, 2019 07:41
f06515e
to
74f148c
Compare
HadrienG2
force-pushed
the
less-inline
branch
from
September 26, 2019 18:52
74f148c
to
17a0354
Compare
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.
Following up on #21, this PR proposes to deal away with most of the manual inline annotations in Abomonation, only keeping those which have a proven positive effect on the library's performance as measured by the built-in benchmark suite (in the sense that there is a before/after statistically significant benchmark timing difference, which can be attributed to a different inlining scheme via perf).
Feel free to propose more benchmarks if you feel that the current benchmark set does not provide good enough coverage of what must be fast yet.
As too often when doing performance fine-tuning in Rust, the nice "multiple codegen units" feature that allows
rustc
to compile stuff fast got in the way by making compilation results (and in particular inlining decisions outside abomonation, e.g. inside of std::test::Bencher) less deterministic. I think that this feature, while undoubtedly worthwhile overall, is a pain for the purpose of precision benchmarking, so I disabled it for the "bench" build profile.For convenience reasons, this PR is based on #22 so I would suggest reviewing #22 first, or reviewing this one commit by commit or via github's "diff range" feature in order to only consider the diff w.r.t. #22.
Fixes #21.