-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
BitArray is much slower than Array{Bool} #13914
Comments
It's true that a lot of the performance penalty comes from not inlining |
UPDATE It seems that I can't tell the difference between milli- and micro-seconds. Equality is clearly faster than the Hi Carlo, thank you for looking into this. function test_bitarr(val, arr)
out = BitArray{2}(size(arr)...)
f = @anon (x)->x==val
map!(f, out, arr)
out
end
function test_bool(val, arr)
out = Array{Bool, 2}(size(arr)...)
f = @anon (x)->x==val
map!(f, out, arr)
out
end
function test_eql(val, arr)
arr .== val
end
|
@cstjean I don't understand your last comments, I suspect you're being misled by the time units (μs vs ms). Is that so? |
@carlobaldassi You're right, I was misled by the time units, please ignore that post. Sorry for the confusion, I will be more careful in my benchmarks. Thank you for #13946, that should fix the issue! |
Old issue: #2360
On Julia 0.4, OSX:
I ran into this because my code has a line:
and this calls
bitneq_cache
. Writing the loop explicitly yields comparable performance if I useBitArray{2}
, but it's 5X faster if I useArray{Bool, 2}
. That's probably because with BitArray, theset_index!
call does not get inlined.The text was updated successfully, but these errors were encountered: