On Thu, Aug 07, 2003 at 11:52:52PM -0700, pineapple wrote:
> Saw this posted on a frost board, thought it might be
> a good idea to forward it here:
> 
> Take a look at the code for probabilistic caching:
> 
> public boolean shouldCache(RandomSource r, float
> cacheProbPerHop) {
>     return r.nextFloat() <
> cacheProbability(cacheProbPerHop);
> }
> 
> public float cacheProbability(float cacheProbPerHop) {
>     return (float)Math.pow((float)cacheProbPerHop,
> hopsSinceReset);
> }
> 
> Shouldn't the cache probability go up instead of down
> as hopsSinceReset increases, so that the data is
> cached more at the specialized end?

This is coming backwards from the datasource. 0 is the datasource and
therefore the specialized end. Since cacheProbPerHop < 1.0, we get
datasource      100% - always cached
1 hop           80%
2 hops          64%
3 hops          51.2% (we never ever see over 3 hops, because it gets
                reset first - see incomingHopsSinceReset)
> 
> If the logic is backwards, that would explain
> Freenet's recent performance.

-- 
Matthew J Toseland - [EMAIL PROTECTED]
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to