in reply to Re: Re: A memory efficient hash, trading off speed - does it already exist?
in thread A memory efficient hash, trading off speed - does it already exist?
$hash{"Keyword\0Symbol_1"} = $Weighting[1]; $hash{"Keyword\0Symbol_2"} = $Weighting[2];
That way you still get full hash lookup performance on the entire (two dimensional) key. And you avoid creating whole legions of hashes. That should pretty much fix 90% of your problem. And such a flat hash is trivial to tie to a DBM file.
Don't knock DBMs without benchmarking them. DBM files are specifically laid out to allow for rapid retrieval - paging just indiscriminately swaps out whatever seems least necessary, including other parts of the system besides the data. Drawing any conclusions about one based on the other borders on ridiculous.
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re^3: A memory efficient hash, trading off speed - does it already exist?
by JPaul (Hermit) on Feb 06, 2003 at 17:57 UTC | |
by Aristotle (Chancellor) on Feb 07, 2003 at 12:57 UTC | |
by JPaul (Hermit) on Feb 07, 2003 at 16:01 UTC | |
by Aristotle (Chancellor) on Feb 07, 2003 at 20:29 UTC |