-
-
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
getindex for BitArrays does not get inlined. #9077
Comments
Currently |
If you need a quick workaround, there seems to be a |
perhaps what we really want is an if @unlikely i > length(a)
throw(error())
else
return a[i]
end inline_worthy could put less weight onto statements inside an |
I would use |
The corresponding |
I just added an
then the before/after timing on my laptop is 0.37s vs 0.12s, a factor of 3.
Actually In the example above, the timings become 0.91s for BitArrays vs 0.35s for Arrays. This is not to say that a |
I'm surprised that I wasn't able to find an open issue about this, so hopefully this isn't a dupe.
I'm guessing this is due to the bounds check? I don't fully understand how
@inbounds
works but I would guess this check does not go away when@inbounds
is used.The text was updated successfully, but these errors were encountered: