MarshalX / python-libipld

🏎️ Fast Python library to work with IPLD: DAG-CBOR, CID, CAR, multibase
https://pypi.org/project/libipld/
MIT License
17 stars 2 forks source link

Improve map keys comparator #24

Closed MarshalX closed 8 months ago

MarshalX commented 8 months ago

a little bit faster?

codspeed-hq[bot] commented 8 months ago

CodSpeed Performance Report

Merging #24 will degrade performances by 22.75%

Comparing improve-map-key-cmp (4c01a80) with main (6af9137)

Summary

⚡ 1 improvements ❌ 7 (👁 7) regressions ✅ 184 untouched benchmarks

Benchmarks breakdown

Benchmark main improve-map-key-cmp Change
👁 test_dag_cbor_decode[roundtrip01.json] 26.2 µs 33.5 µs -21.84%
👁 test_dag_cbor_decode[roundtrip02.json] 26.2 µs 33.6 µs -22.05%
👁 test_dag_cbor_decode[roundtrip05.json] 30.2 µs 37.5 µs -19.46%
test_dag_cbor_decode[roundtrip07.json] 31.4 µs 24 µs +30.84%
👁 test_dag_cbor_decode[roundtrip08.json] 29.4 µs 36.7 µs -20.07%
👁 test_dag_cbor_decode[roundtrip19.json] 29.4 µs 38.1 µs -22.75%
👁 test_dag_cbor_decode[roundtrip22.json] 28.4 µs 36.2 µs -21.55%
👁 test_dag_cbor_decode[roundtrip23.json] 27.5 µs 34.8 µs -20.96%
MarshalX commented 8 months ago

same perf. but using "match" is more rusty way imo