in reply to Re^2: Randomization as a cache clearing mechanism
in thread Randomization as a cache clearing mechanism
Oh, sorry for confusion. Actually, the log involved in your code is a natural log (base e), and the log involved in the discussion is of course base 2. Log base 10 is rarely relevant in anything but counting decimal digits :) Sorry once again, that was the reason I did not write the formula in Perl.
400k vs. 20k means 19 vs 15 seeks in the index (or steps in the binary tree). Do you think it will worth it?
What would be more interesting is to hear about the whole caching infrastructure here on PM. Hundreds of cache-checks per web page sounds like a symptom of something rather strange happening. I'd be very tempted to employ memcached, implement cache-checks pipelining and even try to eliminate checks altogether. If we invalidate the cache for a single node when the node is updated we won't need no versions and no checks at all.
P.S. Your code does not calculate what you think it should. The output equals to log (2000000 - log 1000000).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Randomization as a cache clearing mechanism
by demerphq (Chancellor) on Nov 20, 2004 at 09:47 UTC | |
by kappa (Chaplain) on Nov 20, 2004 at 11:20 UTC | |
by tye (Sage) on Nov 20, 2004 at 19:17 UTC | |
by kappa (Chaplain) on Nov 21, 2004 at 09:53 UTC | |
by ryantate (Friar) on Nov 21, 2004 at 23:01 UTC | |
| |
by demerphq (Chancellor) on Nov 20, 2004 at 12:13 UTC |