in reply to 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?
Indeed I am also considering something similar to this, although I'm not entirely sure if it would work quite as I hope.
The data is constructed like so:
And so on. I think perhaps I could slim down memory considerably by doing something like the following:%hash{Keyword} -> {Symbol_1} = Weighting %hash{Keyword} -> {Symbol_2} = Weighting
And, as Mr_Person has already noted, no I don't intend to use | and , as separators. Already when writing data to the disk as a "brainsave" I use \x255 as a record separator, just like you were thinking. Perhaps the fact that I started programming in BASIC as well might have something to do with our shared mindset? :)%hash{Keyword} = "Symbol_1 | Weighting, Symbol_2 | Weighting"
JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --
In Section
Seekers of Perl Wisdom