[ZODB-Dev] profiling zLOG and inspect

Christian Reis kiko at async.com.br
Sat Jun 14 23:03:24 EDT 2003


Hi there,

we're approaching the final release of one of our client projects, and
I've started to do some weekend profiling to see if I can shave some
time off here and there.

My 2.1/2.2 profile runs are showing me that the import zLOG step is
taking a bit less than 1 second on some of the slower boxes here
(400~500mhz). In the end, it piles down to the fact that import inspect
takes an amazingly long time:

    kiko at banzai:~/ZODB3/ZODB$ python2.1 
    Python 2.1.3 (#1, Sep  7 2002, 15:29:56) 
    [GCC 2.95.4 20011002 (Debian prerelease)] on linux2
    Type "copyright", "credits" or "license" for more information.
    You have pprint, _halt, class Foo Bar:Foo available"
    To call _halt, use _halt(locals())
    >>> import time; t = time.time() ; import inspect ; time.time() - t
    0.76367998123168945

    kiko at banzai:~/ZODB3/ZODB$ python2.2 
    Python 2.2.1 (#1, Sep  7 2002, 14:34:30) 
    [GCC 2.95.4 20011002 (Debian prerelease)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    You have pprint, _halt, class Foo Bar:Foo available"
    To call _halt, use _halt(locals())
    >>> import time; t = time.time() ; import inspect ; time.time() - t
    0.49863600730895996

I know that zLOG will only actually output something if EVENT_LOG_* are
set. What's the opinion of avoiding the zLOG import, and nopping out the
calls to zLOG.register_subsystem and zLOG.LOG when these environment
variables are set?

I realize that in 2.3 things are much better, but I can't run 2.3 on the
client environment; I suppose others are in a similar spot, and 1s of
import time in worst-case scenarios isn't something to sneeze at.

(As a parting note, the whole ZODB import takes an amazingly long time:
    >>> import time; t = time.time() ; import ZODB ; time.time() - t
    1.7814439535140991
so I suppose getting that number down would be highly welcome)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL



More information about the ZODB-Dev mailing list