-
Notifications
You must be signed in to change notification settings - Fork 18
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
iterate on baskets + an optimization #111
Conversation
This comment has been minimized.
This comment has been minimized.
yeah, indeed but I doubt it can ever be improved 3x. Basically, when one iterates over events, especially in parallel, we have a branch: that we can't avoid... I think its performance would look relatively better in the case where the physics workload is >> a few branches...
I'm not sure either, from experience usually it's a mix of compilation time and or type instability (dynamic dispatch) time |
Latest commit factors out the uncommon/slow path from getindex(). This evidently helps the compiler because now we cut down on the getindex() time by a factor of almost 2. Tested on two machines and I see similar reductions. julia> function bar(t)
for evt in t
_ = evt.Muon_pt
end
nothing
end before(note this is on a different machine wrt the original post, hence the faster times to begin with) julia> @time bar(t)
0.888482 seconds (14.30 k allocations: 1.818 GiB, 4.61% gc time)
julia> @time sum(t.nMuon) |> Int
0.495250 seconds (6.08 k allocations: 469.980 MiB, 6.55% gc time)
149322456 afterjulia> @time bar(t)
0.762924 seconds (14.30 k allocations: 1.818 GiB, 5.33% gc time)
julia> @time sum(t.nMuon) |> Int
0.224379 seconds (6.08 k allocations: 469.980 MiB, 5.02% gc time)
149322456 |
wow, insane!! doing lord's work thanks this is great. so now all the time are spent in copying, on the |
Well to put it into perspective all these gains probably get diluted by a factor of 3 when we run on the zlib file, but better than nothing :). We can get blazing fast speeds if we eliminate that pesky copy! 👿 |
btw I think
is getting out of hands. Since |
We could change it to |
there's not really convention, I just don't know how people are gonna use it. |
I'll rename it to |
Awesome 😅 I need more popcorn 😁 |
* iterate on baskets * 10-50% speedup for simple benchmarks * simplify
Add some functions to iterate on baskets.
This lets one bypass the cost of many
getindex()
s...well, also highlighting that
getindex()
can be improved @Moelf :) Also note that uproot takes 0.5s to do the above and C++ root takes 1.1s.By the way,
shows a gap after the orange getindex bar. Not sure what that means. I would've expected the bars above getindex to add up to the full orange bar width...