Skip to content
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

Merged
merged 1 commit into from
Mar 26, 2015

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Mar 25, 2015

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)

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@emberian
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Mar 25, 2015

📌 Commit ba41fbe has been approved by cmr

@Gankra
Copy link
Contributor

Gankra commented Mar 25, 2015

Seriously if basically all code should be #[inline] should we be considering cranking up how aggressively we hint to LLVM to inline things?

@Manishearth
Copy link
Member


thread '<main>' panicked at 'Some tests failed', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/compiletest/compiletest.rs:258
---- [run-pass] bench/bench-io.rs stdout ----

error: compilation failed!
status: exit code: 101
command: i686-apple-darwin/stage2/bin/rustc /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/bench/bench-io.rs -L i686-apple-darwin/test/bench/ --target=i686-apple-darwin -L i686-apple-darwin/test/bench/bench-io.stage2-i686-apple-darwinlibaux -C prefer-dynamic -o i686-apple-darwin/test/bench/bench-io.stage2-i686-apple-darwin --cfg rtopt --cfg debug -O -L i686-apple-darwin/rt
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
warning: crate names soon cannot contain hyphens: bench-io
error: main function not found
error: aborting due to previous error

------------------------------------------

thread '[run-pass] bench/bench-io.rs' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/compiletest/runtest.rs:1482



failures:
    [run-pass] bench/bench-io.rs

http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/4236/steps/test/logs/stdio

bors added a commit that referenced this pull request Mar 25, 2015
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)
@erickt
Copy link
Contributor Author

erickt commented Mar 25, 2015

@bors: r=cmr rollup

@bors
Copy link
Contributor

bors commented Mar 25, 2015

📌 Commit 92e72ee has been approved by cmr

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 26, 2015
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)
erickt added a commit to erickt/rust that referenced this pull request Mar 26, 2015
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)
erickt added a commit to erickt/rust that referenced this pull request Mar 26, 2015
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 added a commit that referenced this pull request Mar 26, 2015
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
Copy link
Contributor

bors commented Mar 26, 2015

⌛ Testing commit 92e72ee with merge 199bdcf...

@bors bors merged commit 92e72ee into rust-lang:master Mar 26, 2015
@arthurprs
Copy link
Contributor

@gankro that's exactly my felling.

@erickt
Copy link
Contributor Author

erickt commented Apr 1, 2015

@gankro: Doesn't llvm need the functions in the metadata to do inlining across crates? Assuming of course we're not using LTO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants