scikit-hep / uproot5

ROOT I/O in pure Python and NumPy.
https://uproot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
239 stars 76 forks source link

perf: if first whole TBasket has inconclusive AwkwardForth #1280

Closed jpivarski closed 3 months ago

jpivarski commented 3 months ago

@nikoladze found a performance bug: if the first whole TBasket has inconclusive AwkwardForth, the code (before this PR) concatenated everything and ran the whole array through a generic iterable → Awkward Array transformation. The problem is that almost all of the data had been an Awkward Array already, all but the one TBasket with inconclusive AwkwardForth.

This PR adds an extra check for this case. If the list of basket-arrays is only partially Awkward, it converts the non-Awkward ones to Awkward individually so that the concatenated array doesn't have to be passed through the unnecessary generic iterable → Awkward Array transformation.

(There aren't any tests for this because it's based on private data.)

matthewfeickert commented 3 months ago

@jpivarski Could we get another patch release with this in? :grimacing: Sorry, I know we've been asking for them frequnetly.