Commit 44aa0d6d authored by Julien Muchembled's avatar Julien Muchembled

client: give an example to adjust level of cached items according to their size

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2715 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4f2d91c4
......@@ -144,8 +144,10 @@ class ClientCache(object):
self._remove(item)
item.counter = counter = item.counter + 1
# XXX It might be better to adjust the level according to the object
# size.
item.level = 1 + int(_log(counter, 2))
# size. See commented factor for example.
item.level = 1 + int(_log(counter, 2)
# * (1.01 - float(len(item.data)) / self._max_size)
)
self._add(item)
self._time = time = self._time + 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment