-
Notifications
You must be signed in to change notification settings - Fork 5
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
Base alias checking kills performance (on 0.7) #3
Comments
Try using the
Also, the UnsafeArray is created only once, which saves a little bit of time in the loops. Regarding |
This seems to do the trick:
Could you test/confirm, @KristofferC ? If it works fine for you as well, I'll add it to UnsafeArrays.jl. |
Probably will need to specialize |
Fixed in e76a847. |
Thanks again for pointing me to |
Trying out the example in https://discourse.julialang.org/t/avoiding-memory-allocation-for-vector-operations/12447/3 with this package we get:
Disabling the aliasing detection (which falls back to
objectid
which is slow):which is almost as good as the handwritten loop version. For normal
SubArrays
, Base has a custom written version ofmightalias
: https://github.com/JuliaLang/julia/blob/b6a60dd6601a6947e00a0a77decd283248ba8a7f/base/multidimensional.jl#L703-L717, perhaps one could be added here?Or in the unsafe manner disable this and document that unsafe views are not allowed to alias.
The text was updated successfully, but these errors were encountered: