perf: Pre-compute hugr capacity when decoding a hugr-model - #3219
Conversation
528901e to
49361e7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3219 +/- ##
==========================================
+ Coverage 81.55% 81.58% +0.02%
==========================================
Files 242 242
Lines 47309 47408 +99
Branches 40906 41005 +99
==========================================
+ Hits 38584 38677 +93
- Misses 6713 6716 +3
- Partials 2012 2015 +3
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:
|
49361e7 to
c47913a
Compare
Merging this PR will improve performance by 14.17%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | serialization/big_hugr/1048576/capnp/with_extensions/encode |
17.6 ms | 15.4 ms | +14.17% |
| ⚡ | serialization/big_hugr/1048576/capnp/without_extensions/encode |
17.6 ms | 15.4 ms | +14.16% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ab/perf-model-import-capacity (2bdead3) with main (3aa55e9)
c47913a to
cda8967
Compare
cda8967 to
2bdead3
Compare
Analyse the model before allocating the hugr, so we can pass approximate capacities for its internal vectors and avoid vector reallocations during decoding.