From 49e3b22907ac47c9e462a7569e686ee8b6730d06 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 24 Jan 2026 04:52:16 -0600 Subject: [PATCH] scripts: csv.py: Fixed bottleneck from overlapping by/from fields Found from some confusing behavior when by/from fields overlap. It turns out when this happens (-bhi -Fhi, for example), the generated getattr for the by field would trigger the __getattribute__ for the overlapping field field, resulting in a fold on _every add operation_. Hopefully you can see where this is a bit of a problem when summing a large number of results (O(n^2)?). --- Fixed by switching getattr to object.__getattribute__ and reconsidering csv.py's entire design. --- scripts/csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/csv.py b/scripts/csv.py index 7eff2d6c..9b9e7b01 100755 --- a/scripts/csv.py +++ b/scripts/csv.py @@ -1662,7 +1662,7 @@ def compile(fields_, results, # lazily fold results return self.__class__.__mro__[1].__new__(self.__class__, **( - {k: getattr(self, k) for k in by} + {k: object.__getattribute__(self, k) for k in by} | {k: extend( object.__getattribute__(self, k), object.__getattribute__(other, k))