-
-
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
changed broadcast! into bitarray algorithm #32048
Conversation
Ok, this does not work for cartesian indices. Multidimensional variants I tried:
and
None of these present an unambiguous win on my machine. So I restricted the new alg to bitvectors, for the time being. Any ideas how to get the fast variant for higher-dimensional arrays? The best way would be to propagate |
This is great — thanks. Definitely an improvement over the bitcache. And I do think it should be possible to get this fast for n-dimensional broadcasts, too, but it is indeed tricky. This gets us a bit closer:
But the trouble is that we're still introducing a branch with |
If we somehow managed to get linear indexing working for common constructions, then I think that we could maybe remove the bitcache logic entirely (also from bitarray constructors), replacing it by caching a single
|
Cf https://discourse.julialang.org/t/broadcast-vs-slow-performance-allocations/24259/6 for some more discussion and #32047 for the question of validity in view of exceptions.
@mbauman is this valid with respect to
eachindex
, etc?Before:
After:
Monkeypatch: