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.
I just observed the recursive cycles from
hashmap_put2andrehashform inhashmap.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.