-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Refactored code to access TLS only in case of panic #34836
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks @cynicaldevil! Two things I'm curious about:
|
Sure! no problem.
|
do I need to pass additional flags while compiling or is the
|
Yeah you'll want something like: #![feature(test)]
extern crate test;
#[bench]
fn foo(bh: &mut test::Bencher) {
bh.iter(|| /* thing to benchmark */);
}
|
e818577
to
b28e9dc
Compare
I put the assert statement before the return now, and also ran the benchmarks:
my-toolchain
nightly
Tbh, there isn't much of a difference, I ran these a few times and the time difference was always in the range of 100ns. Sometimes, the nightly was faster than my custom build. Tested on Ubuntu. |
Oh actually could this be just a micro-benchmark for
It's true yeah that |
@alexcrichton Here it is:
my-toolchain
nightly
|
Oh dear, shouldn't have hit the merge button... I guess let's see if it passes! |
…=eddyb Revert rust-lang#34836 "Refactored code to access TLS only in case of panic" It has likely caused the last two builds to fail: * https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/1774 * https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/1776 (the PR was accidentally merged without going through @bors).
Revert #34836 "Refactored code to access TLS only in case of panic"
Yeah sorry about that! I've merged the revert, @cynicaldevil would you mind reopening and I'll r+ correctly this time around? |
Fixes #34787
r? @alexcrichton