On 4/19/20 3:51 PM, Koichi Murase wrote:
>
> The associative arrays in `hashlib.c' are implemented by hash tables
> as is clear from its name. The main lookup of hash table algorithm is
> done by the following line
>
> bucket = HASH_BUCKET (string, table, hv);
>
> but not by the subsequent linear search. The linear search is just a
> workaround for the collision of hashes. As far as the load factor of
> the hash table is maintained properly, the linear search is O(1)
> because the length of the list is O(1).
>
> 2020-04-19 23:54 George Jones <[email protected]>:
>> This slows down (order N?) new inserts when the number of entries
>> gets large.
>
> I looked into `hashlib.c' and found that rehashing is actually not
> implemented. I just added a function to perform rehashing, and
> the performance has been improved.
Thanks for the patch. This will be in the next devel branch push.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/