Skip to content

Optimize DAG-CBOR map decode with key-intern cache and KnownHash insert#106

Merged
MarshalX merged 4 commits into
mainfrom
optimize-decode-key-intern-cache
May 26, 2026
Merged

Optimize DAG-CBOR map decode with key-intern cache and KnownHash insert#106
MarshalX merged 4 commits into
mainfrom
optimize-decode-key-intern-cache

Conversation

@MarshalX

Copy link
Copy Markdown
Owner

@MarshalX MarshalX changed the title Optimize DAG-CBOR string decode with ASCII fast path Optimize DAG-CBOR map decode with key-intern cache and KnownHash insert May 25, 2026
@codspeed-hq

codspeed-hq Bot commented May 25, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 21.47%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 14 improved benchmarks
✅ 178 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation test_dag_cbor_decode_fixtures[dagpb_11unnamedlinks+data] 33.4 µs 27.8 µs +20.06%
Simulation test_dag_cbor_decode_fixtures[dagpb_4namedlinks+data] 23.7 µs 21.2 µs +11.93%
Simulation test_dag_cbor_decode_fixtures[dagpb_7unnamedlinks+data] 27.2 µs 23.7 µs +15.06%
Simulation test_dag_cbor_decode_fixtures[dagpb_Data_zero] 14.5 µs 13 µs +11.13%
Simulation test_dag_cbor_decode_fixtures[dagpb_empty] 13.5 µs 12.1 µs +11.51%
Simulation test_dag_cbor_decode_fixtures[garbage-03] 38.8 µs 34.6 µs +12.28%
Simulation test_dag_cbor_decode_fixtures[garbage-18] 40.1 µs 35.3 µs +13.68%
Simulation test_dag_cbor_decode_fixtures[garbage-19] 26.6 µs 23.8 µs +11.64%
Simulation test_dag_cbor_decode_fixtures[map-1_pair] 13.2 µs 12 µs +10.47%
Simulation test_dag_cbor_decode_fixtures[map-keysort] 18.2 µs 15.9 µs +14.59%
Simulation test_dag_cbor_decode_real_data[citm_catalog.json] 19.9 ms 14.4 ms +38.74%
Simulation test_dag_cbor_decode_real_data[github.json] 731.5 µs 494.4 µs +47.96%
Simulation test_dag_cbor_decode_real_data[twitter.json] 8.1 ms 5.2 ms +54.19%
Simulation test_decode_car 511.4 ms 367.5 ms +39.18%

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 optimize-decode-key-intern-cache (f7b0694) with main (4ea29bb)

Open in CodSpeed

@MarshalX

Copy link
Copy Markdown
Owner Author

Decoding 🚀

image image

@MarshalX MarshalX merged commit d2eaf4d into main May 26, 2026
5 checks passed
@MarshalX MarshalX deleted the optimize-decode-key-intern-cache branch May 26, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant