[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: George Jones
Subject: Re: [PATCH] Implement rehashing for associative arrays (Re: speeding up hash_search?)
Date: Mon, 20 Apr 2020 17:12:28 -0400

No real opinion on syntax.

Using something existing:

    declare -A foo[SIZE]

seems sensible, especially if there was no semantic meaning (I'm not a fan
of syntax without semantics .... clutter).

Big thing is that the new stuff for fringe new pathologic use cases (mine)
should not have negative impact (huge buffer preallocation) on the existing
?30 years? of users/scripts.

Some docs on how the SIZE is used (hint for preallocation of hash table
size, not hard limit on number of entries) probably also in order.

---george jones

On Mon, Apr 20, 2020, 4:23 PM Chet Ramey <address@hidden> wrote:

> On 4/20/20 11:16 AM, George Jones wrote:
> > No problem.   Glad you fixed it.   It's been a LONG time since I've
> > actually written C, so probably best if someone current did it.
> >
> > On the parameters, I suggest you consider exposing the at user level as a
> > switch or env var.   My use case was pathologically large (and would have
> > been better on, e.g. Spark if that were and option in the environment).
> >  Even the old behavior was probably good enough for most people.  It's
> only
> > when you start abusing bash to to "big data" that the problem shows up.
> I've been considering how to provide a way to let users indicate the size
> of an array when they declare it. `declare' accepts `declare -a name[size]'
> and `declare -A name[size]' for compatibility with ksh, but has never done
> anything with `size'.
> I could see allowing a number, or maybe an arithmetic expression, for SIZE
> to set the initial size of an associative array. Or maybe an additional
> option to `declare' would work better. I don't like using a shell variable
> for this.
> What does the group think?
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]