[for anyone who has been wondering why I have been so quiet over the
past few days it is because I was in Edinburgh working on another
project of mine - building up an immunity to alcohol through extreme
exposure]

Anyway, I did do a little bit of thinking about how to give priority to
smaller data in the DataStore.  Here is my proposal:

Rather than simple moving data straight to the top of the datastore when
it is re-requested, it is moved up the queue an ammount inversely
proportional to its size.  More accurately, if the datastore is of size
n (and here I refer to the portion of the datastore containing actual
data, not just references) a piece of data of size p should be moved up
by nq/p where q is the size of the smallest piece of data.  If doing
this results in the data being moved up beyond the top of the queue then
it is placed at the top of the queue.  This means that the smallest
piece of data (unless I have fscked up the math) will always be moved
straight to the top of the datastore, but other data will have to work
harder in proportion to its size (so a piece of data twice the size of
the smallest piece of data will have to get 2 hits to get to the top of
the queue if it starts at the bottom).

This is a slight simplification since not all items in the queue are the
same size, but if you understand the above it should be reasonably clear
how to handle this complication.

Comments?

Ian.

_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to