perf: use sparse updates for dataflow value rows - #1862
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ab/const-fold-benches #1862 +/- ##
=========================================================
- Coverage 86.59% 86.46% -0.14%
=========================================================
Files 202 202
Lines 32692 32791 +99
Branches 31206 31305 +99
=========================================================
+ Hits 28310 28353 +43
- Misses 3097 3152 +55
- Partials 1285 1286 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by ×2.4
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | constant_fold/wide_tuple[512] |
198.8 ms | 35.2 ms | ×5.6 |
| ⚡ | constant_fold/wide_tuple[128] |
17.2 ms | 8.8 ms | +94.73% |
| ⚡ | constant_fold/wide_tuple[32] |
3.1 ms | 2.5 ms | +22.54% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ab/const-fold-perf-tuples (a87a7da) with ab/const-fold-benches (ce9846d)
The node_in_value_row rule previously allocated a full bottom-filled row for every input-wire update and joined every element into the stored row. For wide nodes this makes row assembly quadratic in the number of inputs and dominated constant-folding time. Represent individual input updates sparsely while retaining dense rows for stored lattice values and operation results. Joining the common dense-plus-sparse case now touches only the updated slot.
2a5987d to
a87a7da
Compare
Warning
This PR was mostly generated by an LLM as a proof of concept.
I'll rewrite it once we see the perf numbers.
The
node_in_value_rowrule previously allocated a full bottom-filled row for every input-wire update and joined every element into the stored row. For wide nodes this makes row assembly quadratic in the number of inputs and dominated constant-folding time.Represent individual input updates sparsely while retaining dense rows for stored lattice values and operation results. Joining the common dense-plus-sparse case now touches only the updated slot.