Re: Question about RamCacheLRU

2012-12-30 Thread Yunkai Zhang
On Sun, Dec 30, 2012 at 6:41 PM, Yunkai Zhang wrote: > > > > On Sun, Dec 30, 2012 at 12:50 PM, Yunkai Zhang wrote: > >> >> >> >> On Sun, Dec 30, 2012 at 12:17 PM, John Plevyak wrote: >> >>> Lol, If they have optimized it by removing the LRU nature, it was perhaps >>> overzealous, or perhaps your

Re: Question about RamCacheLRU

2012-12-30 Thread Yunkai Zhang
On Sun, Dec 30, 2012 at 12:50 PM, Yunkai Zhang wrote: > > > > On Sun, Dec 30, 2012 at 12:17 PM, John Plevyak wrote: > >> Lol, If they have optimized it by removing the LRU nature, it was perhaps >> overzealous, or perhaps your workload is such that it fits within the RAM >> cache so replacement

Re: Question about RamCacheLRU

2012-12-29 Thread Yunkai Zhang
On Sun, Dec 30, 2012 at 12:17 PM, John Plevyak wrote: > Lol, If they have optimized it by removing the LRU nature, it was perhaps > overzealous, or perhaps your workload is such that it fits within the RAM > cache so replacement is not an issue. Without the LRU there are > approximately the same

Re: Question about RamCacheLRU

2012-12-29 Thread John Plevyak
Lol, If they have optimized it by removing the LRU nature, it was perhaps overzealous, or perhaps your workload is such that it fits within the RAM cache so replacement is not an issue. Without the LRU there are approximately the same number of buckets as objects, so replacement based on bucket wo

Re: Question about RamCacheLRU

2012-12-29 Thread Yunkai Zhang
On Sun, Dec 30, 2012 at 1:57 AM, John Plevyak wrote: > This code in ::put() implements the LRU, and as you can see, it uses the > LRU data structure (i.e. simple list from most recently used to least): > > while (bytes > max_bytes) { > RamCacheLRUEntry *ee = lru.dequeue(); > if (ee) >

Re: Question about RamCacheLRU

2012-12-29 Thread John Plevyak
This code in ::put() implements the LRU, and as you can see, it uses the LRU data structure (i.e. simple list from most recently used to least): while (bytes > max_bytes) { RamCacheLRUEntry *ee = lru.dequeue(); if (ee) remove(ee); else break; } On Sat, Dec 29, 2012 a