[Zope-dev] Call Profiler

Richard Jones rjones@ekit-inc.com
Fri, 1 Feb 2002 12:13:12 +1100


I've just announced our Call Profiler product on zope.org and the zope 
announce list (waiting for people in different timezones to authorise them :)
  ( http://www.zope.org/Members/richard/CallProfiler/  for the impatient)

In a nutshell, it patches the rendering guts of DTMLMethod, ZSQL, etc. and 
the ZPublisher so that we can get timing marks for requests as the calls are 
made. The patching is quite simple (once I got the hang of it ;) and 
reversible, and means that there's no changes required to the Zope core to 
enable the testing (which our initial versions did).

It does pose a question though: would it be better to have support for this 
stuff in the core, or is it OK for a product like this to dynamically patch 
the call methods when it needs to?

On one hand, the performance hit when dynamically patching the methods is 
zero when the product is not "active", but it does mean diddling with methods 
that really probably should be left alone. On the other hand, having changes 
to the core code to test for profiling being enabled introduces a small 
performance hit even when profiling is not activated.

Any comments?


    Richard