Skip to content

Make BitVec::process faster (branch free). #25095

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

Merged
merged 1 commit into from
May 5, 2015

Conversation

huonw
Copy link
Member

@huonw huonw commented May 4, 2015

This makes the bit::vec::bench::bench_bit_vec_big_union benchmark go
from 774 ns/iter (+/- 190) to 602 ns/iter (+/- 5).

(There's room for more work here too: if one can guarantee 128-bit
alignment for the vector, the compiler actually optimises union,
intersection etc. to SIMD instructions, which end up being ~5x faster
that the original version, and 4x faster than the optimised version in
this patch.)

This makes the `bit::vec::bench::bench_bit_vec_big_union` benchmark go
from `774 ns/iter (+/- 190)` to `602 ns/iter (+/- 5)`.

(There's room for more work here too: if one can guarantee 128-bit
alignment for the vector, the compiler actually optimises `union`,
`intersection` etc. to SIMD instructions, which end up being ~5x faster
that the original version, and 4x faster than the optimised version in
this patch.)
@rust-highfive
Copy link
Contributor

r? @brson

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

@alexcrichton
Copy link
Member

@bors: r+ 4b46546

Nice!

bors added a commit that referenced this pull request May 5, 2015
This makes the `bit::vec::bench::bench_bit_vec_big_union` benchmark go
from `774 ns/iter (+/- 190)` to `602 ns/iter (+/- 5)`.

(There's room for more work here too: if one can guarantee 128-bit
alignment for the vector, the compiler actually optimises `union`,
`intersection` etc. to SIMD instructions, which end up being ~5x faster
that the original version, and 4x faster than the optimised version in
this patch.)
@bors
Copy link
Collaborator

bors commented May 5, 2015

⌛ Testing commit 4b46546 with merge 0be117e...

@bors bors merged commit 4b46546 into rust-lang:master May 5, 2015
@Gankra
Copy link
Contributor

Gankra commented May 5, 2015

if one can guarantee 128-bit alignment for the vector

An argument for changing the repr from u32 to [some SIMD type]?

@huonw huonw deleted the faster-bitvec branch May 5, 2015 05:06
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.

6 participants