in reply to Efficiency Question
My first reflex if you use a list with ids would be to use a hash instead, the keys being the id and the values the data. To purge an item just do a delete $cache->{$id}.
If you want to add a time stamp or something so that you can purge the cache every now and then you then either need another hash (id => weight, time or whatever criteria you will use) or store an array [criteria, data] in each value.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Efficiency Question
by mr.nick (Chaplain) on Feb 23, 2001 at 19:54 UTC | |
by clintp (Curate) on Feb 23, 2001 at 20:20 UTC | |
by tilly (Archbishop) on Feb 24, 2001 at 01:06 UTC | |
by MeowChow (Vicar) on Feb 24, 2001 at 00:51 UTC |