[ZODB-Dev] ZODB open/close profilings
Christian Reis
kiko@async.com.br
Wed, 11 Dec 2002 10:13:10 -0200
On Tue, Dec 10, 2002 at 02:17:15PM -0500, Jeremy Hylton wrote:
> GW> * but the real culprit is FileStorage._sane(), which takes 28
> GW> sec of the ~48 sec total opening time
>
> I've never thought about the cost of _sane(), so this is a great
> clue. I think part of the problem is that you don't use undo() enough
> <wink>. The code scans the entire data.fs backwards, looking for a
> transaction marked with 'u' for undo. Since you never do an undo, it
> reads the whole file backwards after reading it forwards. Yikes.
True, we have:
1 28.621 28.621 41.913 41.913
/www/python/lib/python2.2/site-packages/ZODB/FileStorage.py:347(_sane)
I wonder if we can cache the fact that no undos were found on the
forward read and avoid the backwards read if true? We never use undo()
either :-)
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL