julia
bcd0e5e3 - Specialize map and map! for BitArrays

Commit
10 years ago
Specialize map and map! for BitArrays Specializing map is even more important for bitarrays than it is for generic arrays since there can be a 64x speedup by working at the level of Int64 instead of looping bit-by-bit. There's no other way to perform operations at the chunk-level without either exporting more functions or mucking around with BitArray's internal fields. This adds functor types that allow mapping across BitArrays 64-bits at a time. Performance of `map(&, x, y)` is now 300x faster and very competitive with `x & y`. In-place `map!` is even faster. The one downside here is that bitwise operations are not typically performed using comparisons... but otherwise a whole slew of new names would need to be exported (e.g., nor, nand, implies, etc.).
Author
Committer
Parents
Loading