[Openmcl-devel] Hash Table performance

Osei Poku osei.poku at gmail.com
Tue Sep 23 22:34:28 UTC 2008


On Sep 23, 2008, at 6:09 PM, Chris Curtis wrote:

>
> On Sep 23, 2008, at 5:58 PM, Osei Poku wrote:
>
>> Hi,
>>
>> CCL extensively uses the ENUMERATE-HASH-KEYS-AND-VALUES function
>> underneath most of hash table functions (MAPHASH, WITH-HASH-TABLE-
>> ITERATOR).  This causes a great deal of waste when iterating  
>> through a
>> very large hash table (like I have now ~10^8 entries).  The way I
>
> If you need to iterate through 10^8 entries, a hash table is simply  
> not the right data structure. For that matter, if you need to  
> iterate through any number of entries, a hashtable is generally a  
> Bad Idea.

This is understood and I am in perfect agreement.  In fact, my  
ultimate intent is quick lookups and not to use the hash table for  
iteration at all.  I was looking into iteration to be able check the  
contents of the hash table for debugging purposes.  I am perfectly  
happy with just being able to grab any key in the hash table and then  
displaying its value.  I guess I got caught up with trying to use  
slime inspector (which uses WITH-HASH-TABLE-ITERATOR) and somewhere  
along the way I lost track of what I actually needed to do in the  
first place.

After utilizing a few more brain cells, I realize I was wasting time  
tackling the wrong problem.  I'm just trying to debug the parser that  
generated the hash table!   I guess I just got lazy from always using  
slime inspector  :)

The problem still remains though.  Is there some slightly less  
expensive way (than enumerating the entire hashtable) of grabbing an  
arbitrary key-value pair from a hash table?

Osei



More information about the Openmcl-devel mailing list