On Thursday 24 April 2003 05:41 am, Toby Dickenson wrote:
(caution; old thread)
On Monday 21 April 2003 2:51 pm, Chris Withers wrote:
Dieter Maurer wrote:
If the whole thing is indeed loaded into memory, then it pretty much defeats the purpose of this code.
One purpose of this code is to reduce latency by allowing the first chunk to be written to the http socket before the last chunk is loaded from disk.
Change it to:
while data is not None: RESPONSE.write(data.data) ndata= data.next data._p_deactivate() data= ndata
Has anyone tested this works?
If so, has anyone checked it in?
If not, could someone open a collector issue so I can check it in ;-)
Deactivating *every* block looks like a bad idea. This defeats the in-memory cache that will be a big win for small files.
I agree.
The memory cache is only a disadvange if your files are large enough that they have enough chunks to disrupt LRU cache policy. How about comparing the number of chunks to a fraction of the cache target size?
I think possibly a better solution is to have an explicit switch on the file like "Disable ZODB caching (recommended for large files)" so that it can be decided as policy on a case-by-case basis. -Casey