Return value usage

Zac Burns zac256 at gmail.com
Wed Apr 29 19:54:02 CEST 2009


> The point of caching is that it lets you retrieve a result cheaply that
> was expensive to produce by saving the result in case it's needed again.
> If the caching itself is expensive because it requires network access
> then, IMHO, that's not proper caching! (You would need a 2-level cache,
> ie a small local cache to speed up your a larger network-based cache; a
> cache for a cache.)
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Agreed, to some extent.

In my application the cache resulted in enormous savings over
calculating every time - but still several minutes could be saved in
some common use cases.

Calculating the values is very expensive indeed (anywhere between
seconds and minutes each). Getting the cached values takes ~.05sec.
However, it is common to request 10000 or so calculations - which
costs ~8min. Of those, perhaps 10% actually use the return value - all
of them use the side effects. Also the full cache is very large - in
the hundreds of GB. Having a local cache wouldn't help because
generally a machine wouldn't request the same cached values twice.
They are borrowing runtime from other machines.

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games



More information about the Python-list mailing list