Skip to content

TTree performance improvements advice needed #1106

Answered by jpivarski
JacekHoleczek asked this question in Q&A
Discussion options

You must be logged in to vote

If these arrays are not ragged (i.e. t[branchname].typename is a C++ value type, such as int32_t or double, possibly fixed-size arrays like float[10], but not variable-length arrays like float[]), then you can use NumPy with library="np" instead of the default Awkward Array, and that would have greater or equal speed.

Be careful to avoid reading the same data multiple times. I don't see any examples of that here, but you can either consolidate all of your array-reading functions in one uproot.TTree.arrays call or use the array_cache argument in both uproot.TTree.arrays and uproot.TBranch.array. (It doesn't do anything magical; it just checks a MutableMapping (dict) that you maintain, firs…

Replies: 3 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by JacekHoleczek
Comment options

You must be logged in to vote
13 replies
@jpivarski
Comment options

@JacekHoleczek
Comment options

@jpivarski
Comment options

@JacekHoleczek
Comment options

@JacekHoleczek
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants