From c0786a46230f79a68670b50f96cb43b9cb2823cc Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Wed, 25 Sep 2024 15:28:33 -0500 Subject: [PATCH] Revert "perf: desperate attempts to unlink output arrays" This reverts commit 6c802274177e00b293d57bec9ae37e7121635f79. --- src/uproot/behaviors/TBranch.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/uproot/behaviors/TBranch.py b/src/uproot/behaviors/TBranch.py index 5d0945287..688ae4de7 100644 --- a/src/uproot/behaviors/TBranch.py +++ b/src/uproot/behaviors/TBranch.py @@ -210,14 +210,10 @@ def iterate( arrays, report = item arrays = library.global_index(arrays, global_offset) report = report.to_global(global_offset) - popper = [arrays] - del arrays - yield popper.pop(), report - + yield arrays, report else: - popper = [library.global_index(item, global_offset)] - yield popper.pop() - + arrays = library.global_index(item, global_offset) + yield arrays except uproot.exceptions.KeyInFileError: if allow_missing: continue @@ -1115,9 +1111,6 @@ def iterate( ak_add_doc, ) - # no longer needed; save memory - del output - next_baskets = {} for branch, basket_num, basket in ranges_or_baskets: basket_entry_start, basket_entry_stop = basket.entry_start_stop @@ -1126,14 +1119,10 @@ def iterate( previous_baskets = next_baskets - # no longer needed; save memory - popper = [out] - del out - if report: - yield popper.pop(), Report(self, sub_entry_start, sub_entry_stop) + yield out, Report(self, sub_entry_start, sub_entry_stop) else: - yield popper.pop() + yield out def keys( self,