By the way, marius, thanks for your great profiling library.

We used it this week to track down our performance issues and could increase the speed of some of our functions by a factor of 10 or more(!)

The zope index checkin's this week result from using your profile decorator. Especially the change in z3c.tag could easily be tracked down by simply adding @profile to our code.


Marius Gedminas wrote:
On Fri, Apr 06, 2007 at 11:15:47PM +0200, Maciej Wisniowski wrote:
does anyone know a method to get or compute the execution time of a
Lori - plugin for firefox, or firebug etc?
Or do you want to display this on page?

Firebug doesn't quite cut it: it only displays time spent downloading,
not the time spent waiting until Zope processes the request.

I usually wrap my view's __call__ in a @timecall decorator like this:

def timecall(fn):
    def new_fn(*args, **kw):
            start = time.time()
            return fn(*args, **kw)
            duration = time.time() - start
            funcname = fn.__name__
            filename = fn.func_code.co_filename
            lineno = fn.func_code.co_firstlineno
            print >> sys.stderr, "\n  %s (%s:%s):\n    %.3f seconds\n" % (
                                        funcname, filename, lineno, duration)
    new_fn.__doc__ = fn.__doc__
    return new_fn

Marius Gedminas


Zope3-users mailing list

Zope3-users mailing list

Reply via email to