Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16178
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: speeding up hash_search? |
| Date | 2020-04-19 15:46 -0400 |
| Organization | ITS, Case Western Reserve University |
| Message-ID | <mailman.721.1587325593.3066.bug-bash@gnu.org> (permalink) |
| References | <CALv3B7aiTbhpyUL17Eg5prH39EgMP8uSDdD554OdND3LFETAQg@mail.gmail.com> <ff83d50d-402f-3287-a4d5-bcfdf7300585@case.edu> |
On 4/19/20 10:53 AM, George Jones wrote: > It looks like hash_search just does a linear walk if array entries to find > elements in a list. This slows down (order N?) new inserts when the > number of entries gets large. Well, that's the collision handling mechanism. You have to have one. If the hash table is sized right -- and it's entirely possible that the default size of the hash table for associative arrays is too small for your use case -- it's not much overhead. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Back to gnu.bash.bug | Previous | Next | Find similar
Re: speeding up hash_search? Chet Ramey <chet.ramey@case.edu> - 2020-04-19 15:46 -0400
csiph-web