-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Greatly speed up reading/writing slices with #[inline] #23680
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ rollup |
📌 Commit ba41fbe has been approved by |
Seriously if basically all code should be #[inline] should we be considering cranking up how aggressively we hint to LLVM to inline things? |
http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/4236/steps/test/logs/stdio |
When built with `rustc -O`: before: test bench_read_slice ... bench: 68 ns/iter (+/- 56) test bench_read_vec ... bench: 78 ns/iter (+/- 21) test bench_write_slice ... bench: 133 ns/iter (+/- 46) test bench_write_vec ... bench: 308 ns/iter (+/- 69) after: test bench_read_slice ... bench: 32 ns/iter (+/- 10) test bench_read_vec ... bench: 32 ns/iter (+/- 8) test bench_write_slice ... bench: 53 ns/iter (+/- 12) test bench_write_vec ... bench: 247 ns/iter (+/- 172)
@bors: r=cmr rollup |
📌 Commit 92e72ee has been approved by |
before: test bench_read_slice ... bench: 68 ns/iter (+/- 56) test bench_read_vec ... bench: 78 ns/iter (+/- 21) test bench_write_slice ... bench: 133 ns/iter (+/- 46) test bench_write_vec ... bench: 308 ns/iter (+/- 69) after: test bench_read_slice ... bench: 32 ns/iter (+/- 10) test bench_read_vec ... bench: 32 ns/iter (+/- 8) test bench_write_slice ... bench: 53 ns/iter (+/- 12) test bench_write_vec ... bench: 247 ns/iter (+/- 172)
before: test bench_read_slice ... bench: 68 ns/iter (+/- 56) test bench_read_vec ... bench: 78 ns/iter (+/- 21) test bench_write_slice ... bench: 133 ns/iter (+/- 46) test bench_write_vec ... bench: 308 ns/iter (+/- 69) after: test bench_read_slice ... bench: 32 ns/iter (+/- 10) test bench_read_vec ... bench: 32 ns/iter (+/- 8) test bench_write_slice ... bench: 53 ns/iter (+/- 12) test bench_write_vec ... bench: 247 ns/iter (+/- 172)
before: test bench_read_slice ... bench: 68 ns/iter (+/- 56) test bench_read_vec ... bench: 78 ns/iter (+/- 21) test bench_write_slice ... bench: 133 ns/iter (+/- 46) test bench_write_vec ... bench: 308 ns/iter (+/- 69) after: test bench_read_slice ... bench: 32 ns/iter (+/- 10) test bench_read_vec ... bench: 32 ns/iter (+/- 8) test bench_write_slice ... bench: 53 ns/iter (+/- 12) test bench_write_vec ... bench: 247 ns/iter (+/- 172)
before: test bench_read_slice ... bench: 68 ns/iter (+/- 56) test bench_read_vec ... bench: 78 ns/iter (+/- 21) test bench_write_slice ... bench: 133 ns/iter (+/- 46) test bench_write_vec ... bench: 308 ns/iter (+/- 69) after: test bench_read_slice ... bench: 32 ns/iter (+/- 10) test bench_read_vec ... bench: 32 ns/iter (+/- 8) test bench_write_slice ... bench: 53 ns/iter (+/- 12) test bench_write_vec ... bench: 247 ns/iter (+/- 172)
@gankro that's exactly my felling. |
@gankro: Doesn't llvm need the functions in the metadata to do inlining across crates? Assuming of course we're not using LTO. |
before:
test bench_read_slice ... bench: 68 ns/iter (+/- 56)
test bench_read_vec ... bench: 78 ns/iter (+/- 21)
test bench_write_slice ... bench: 133 ns/iter (+/- 46)
test bench_write_vec ... bench: 308 ns/iter (+/- 69)
after:
test bench_read_slice ... bench: 32 ns/iter (+/- 10)
test bench_read_vec ... bench: 32 ns/iter (+/- 8)
test bench_write_slice ... bench: 53 ns/iter (+/- 12)
test bench_write_vec ... bench: 247 ns/iter (+/- 172)