AdamNiederer / faster

SIMD for humans
Mozilla Public License 2.0
1.56k stars 51 forks source link

Remove unnecessary assert in next_vector #15

Closed Osveron closed 6 years ago

Osveron commented 6 years ago

First thing that happens in next_vector function is check if there is enough elements in data to do the load to simd vector, but it seems that the compiler is not able to remove assert from load function. So I have changed it to load_unchecked. The only benchmark available in this crate that is affected is: tests::bench_nop_simd 144 88 -56 -38.89% x 1.64 but my application that goes over much bigger collection than this used in benchmarks speeds up from 14 to 12 seconds.

AdamNiederer commented 6 years ago

Wow, nice catch! I'll merge as soon as Travis clears.

AdamNiederer commented 6 years ago

Update: This speeds up bytecount's core algorithm by 14%. Awesome job! I'm going to put out 0.4.3 with just this change.