|
From: | Jörg F . Wittenberger |
Subject: | Re: [Chicken-hackers] [PATH] Use hash table instead of flat list for lambda literals |
Date: | 14 Feb 2012 12:04:22 +0100 |
On Feb 13 2012, Peter Bex wrote:
On Mon, Feb 13, 2012 at 03:11:05PM -0700, Alan Post wrote:I do think that choice is fine, yes. Does the hash table resize itself when it gets too many entries in it?No, unfortunately these hash tables are pretty basic and too low-level to do such things.
Just in case hash table turn out not to be too helpful (and not implying that balanced trees would really help) it might be helpful to have some alternative. Best regards /Jörg (Maybe someone fluent with the egg system could turn this into an egg anyway?) This file should is original name "aggregate-chicken.scm" http://askemos.org/A5ffdc9d14b6e2dbb899e2240ea8ea99b It implements a hashtable API to LLRB-trees. Two examples: a) LLRB tree indexed by symbols implemented as a pure data structure and b) a tree indexed by strings and updated in place with no additional allocation. The actual implementation is done by this code http://askemos.org/A532a4158b6424c2c2d2b8b5b08d32994 "llrbtree.scm" (In comment this contains yet one more example: and integer-index tree). The code conditionally expands either to the use of records (for the sake of safety and testing) or direct ##sys#slot references (for speed). This code is actually rather well tested. (As you might have noted I'm running quite some network related code constantly. This used to spell problems with chicken's time queue handling. That's the code, which replaced those linear lists in my chicken. (Amounts to x*10^6 threads a day installing timeouts around their i/o. The symbol and string tables are actually used to implement variable ennvironments.)
[Prev in Thread] | Current Thread | [Next in Thread] |