Subj : Re: Writable source equals Reusable source To : comp.programming From : CBFalconer Date : Fri Aug 19 2005 07:42 pm websnarf@gmail.com wrote: > .... snip ... > > 5) Let me propose a very simple problem for you. I want to implement a > cookie database for my webbrowser. The cookies will come in the form > of the following 4-tuple: (file, host, key, value). So what I want is > a sequence of nested hash tables that indexed first by the filename, > then the host, then the key, which will finally yield the value to me. > Does your hash table design, which as I recall was based on static > instances, scale to solve a problem like this? Note that this is not 3 > hash tables -- its 3 *LEVELS* of hash tables. (I think CBFalconer's > can do this, so long as you have fewer than about 8 million of any > given index.) Hashlib can easily change that limit in one place in the source. Since a record will rarely be appreciably less that 20 odd bytes, that has already allowed for about 160 Mb of storage. Larger values are very likely to start using virtual memory, and thrash when the content becomes large enough, with quite serious degradation of performance. This would not be pleasant when used for eg. a compilers symbol tables. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson .