Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16184

Re: [PATCH] Implement rehashing for associative arrays (Re: speeding up hash_search?)

From Koichi Murase <myoga.murase@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: [PATCH] Implement rehashing for associative arrays (Re: speeding up hash_search?)
Date 2020-04-20 18:48 +0900
Message-ID <mailman.774.1587376155.3066.bug-bash@gnu.org> (permalink)
References <CALv3B7aiTbhpyUL17Eg5prH39EgMP8uSDdD554OdND3LFETAQg@mail.gmail.com> <CAFLRLk8ydO6ev8wRcJ35kzzN3Yt2_9sjsc6L+C0CC6dCxud_NA@mail.gmail.com> <CALv3B7bzh3degKPCe5c_avUc90L+bE8jqKKcaVo13zwqEyB5-A@mail.gmail.com> <CAFLRLk-XAU3rrRHy1wWdY7Py-gkLaU-UfiPc47MOEA8eutYx1A@mail.gmail.com>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

2020-04-20 10:00 George Jones <fooologist@gmail.com>:
> Thank you.  Patch applied and (performance) tested with come tests
> I was working on
> https://github.com/eludom/snippits/tree/master/bash/tests
> .... bottom line:

Thank you for the measurements.

Also, I am sorry that I disturbed your plan for contributing to Bash.
I actually initially doubted that the insertion with the current
implementation is O(N), so I created the test first and then found
that it is an easy fix rather than reimplementing it by B-tree or
other data structures.  I couldn't stop my interest in how much it is
improved by the easy fix.

Nevertheless, I have not tuned the parameters of rehashing.  Actually
it is a tradeoff between the memory consumption and the computational
time, so it is a matter of preference to some extent.  I attach an
updated patch which exposes some parameters.  If you have an interest,
you can play by changing the value of the parameters
`HASH_REHASH_MULTIPLIER' and `HASH_MAX_LOADFACTOR' defined in
`hashlib.h'.

--
Koichi

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: [PATCH] Implement rehashing for associative arrays (Re: speeding up hash_search?) Koichi Murase <myoga.murase@gmail.com> - 2020-04-20 18:48 +0900

csiph-web