Commit 9b4703b
Use per-attribute node.attribute() for cell t/s/r
Follow-up to the rows_generator optimization. Fetch the three cell
attributes with individual node.attribute('t'/'s'/'r') C calls instead of
building a per-cell attribute_hash and indexing it. With hundreds of
thousands of cells the per-cell Hash allocation dominates, so three cheap
lookups are both faster and leaner.
Same 20,000-row x 40-col benchmark, vs the attribute_hash version:
| Cell-attr approach | Median | Allocations |
|------------------------|---------|-------------|
| node.attribute_hash | ~1.10s | 9,226,711 |
| node.attribute() x3 | ~1.08s | 7,626,711 |
=> ~3-4% faster, 1.6M (~17%) fewer allocations (deterministic: ~640K
cells x the per-cell hash no longer built).
Output byte-identical across rows, simple_rows, and rows_with_meta_data on
both default- and prefixed-namespace files. Suite green (47 examples).
The row-opener node keeps attribute_hash (only ~one per row, and it
preserves the exact meta-data row hash).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 710d0ee commit 9b4703b
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
0 commit comments