Skip to content
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

Potential inefficiencies due to cyclic dependency #155

Open
s311354 opened this issue Jan 22, 2025 · 0 comments
Open

Potential inefficiencies due to cyclic dependency #155

s311354 opened this issue Jan 22, 2025 · 0 comments

Comments

@s311354
Copy link

s311354 commented Jan 22, 2025

I just observed the recursive cycles from hashmap_put2 and rehash form in hashmap.c, which might impact on the potential infinite recursion or excessive dependency.

I think the we could allocate new buckets and just directly update existing hashmap during rehashing to reduce recursion and improving clarity.

In particular, using gprof to measure function-level performance, I noticed some interesting behavior. The proposed changes aimed to optimize get_or_insert_entry and reduce the recursive dependencies between hashmap_put2 and rehash.

I put the reduced recursive dependencies proposal at #154 for reference.

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

No branches or pull requests

1 participant