Skip to content

Replace pair_list with hash table #1128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 80 commits into
base: master
Choose a base branch
from
Draft

Replace pair_list with hash table #1128

wants to merge 80 commits into from

Conversation

asvetlov
Copy link
Member

@asvetlov asvetlov commented Apr 5, 2025

No description provided.

Copy link

codspeed-hq bot commented Apr 7, 2025

CodSpeed Performance Report

Merging #1128 will degrade performances by 28.85%

Comparing ht (cab2a3e) with master (99e3f3b)

Summary

⚡ 66 improvements
❌ 11 regressions
✅ 167 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_cimultidict_add_istr[c-extension-module] 2.7 ms 3.5 ms -23.57%
test_cimultidict_delitem_istr[c-extension-module] 86 µs 63.2 µs +36.17%
test_cimultidict_extend_istr[c-extension-module] 2.4 ms 2.9 ms -15.89%
test_cimultidict_extend_istr_with_kwargs[c-extension-module] 6.5 ms 7.6 ms -14.48%
test_cimultidict_fetch_istr[c-extension-module] 57.9 µs 45.3 µs +27.98%
test_cimultidict_get_istr_hit[c-extension-module] 69.5 µs 56.9 µs +22.08%
test_cimultidict_get_istr_hit_with_default[c-extension-module] 71.4 µs 58.8 µs +21.3%
test_cimultidict_get_istr_miss[c-extension-module] 73.1 µs 46.3 µs +57.86%
test_cimultidict_get_istr_with_default_miss[c-extension-module] 75.1 µs 48.4 µs +55.29%
test_cimultidict_getall_istr_miss[c-extension-module] 16.3 µs 14.7 µs +10.81%
test_cimultidict_insert_istr[c-extension-module] 66.3 µs 48.2 µs +37.64%
test_cimultidict_pop_istr[c-extension-module] 83.5 µs 73.4 µs +13.75%
test_cimultidict_update_istr[c-extension-module] 126.8 µs 45.1 µs ×2.8
test_cimultidict_update_istr_with_kwargs[c-extension-module] 294.9 µs 149.9 µs +96.8%
test_copy_from_existing_cimultidict[c-extension-module] 18.9 µs 17.3 µs +9.06%
test_create_cimultidict_with_dict_istr[c-extension-module] 40.5 µs 44.9 µs -9.75%
test_create_cimultidict_with_items_istr[c-extension-module] 52.2 µs 46 µs +13.52%
test_create_multidict_with_items[case-sensitive-c-extension-module] 48.3 µs 41.3 µs +16.75%
test_multidict_add_str[case-insensitive-c-extension-module] 5.5 ms 6.4 ms -13.72%
test_multidict_add_str[case-sensitive-c-extension-module] 2 ms 2.8 ms -28.85%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@asvetlov
Copy link
Member Author

asvetlov commented Apr 7, 2025

Heh. Appending new values to the multidict is more expensive, all other ops are faster.

We have a tradeoff, as usual. I think that the lookup is a much more often operation than the multidict filling.
Also, pls keep in mind that the item replacement/deletion also requires a lookup.

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.

2 participants