3 ms·
This would not apply to the Rust method shown in the OP, since that one is operating on only 32 bits at a time. It's unclear how well the benchmarks in this li
by jblow 9y ago
This would not apply to the Rust method shown in the OP, since that one is operating on only 32 bits at a time.
It's unclear how well the benchmarks in this linked article generalize to other applications. If you are just popcounting in a tight loop, probably pretty well, but who does that? In reality you have other things going on, so if this method is occupying too many execution units or polluting your cache, you would see the effect of that on the rest of the program. But it's program-dependent, thus unclear.
- the8472 9y ago> since that one is operating on only 32 bits at a time. https://doc.rust-lang.org/std/primitive.u64.html#method.count_ones https://doc.rust-lang.org/std/primitive.u64.html#method.coun... https://doc.rust-lang.org/std/primitive.u128.html#method.count_ones https://doc.rust-lang.org/std/primitive.u128.html#method.cou... Of course to benefit from the SSE optimizations you would still have to call it in a loop and the optimizer would have to recognize that and replace it with a vectorized approach.
- jackmott 9y agoyou can do the simd intrinsics explicitly as well