robert rottermann wrote at 2007-9-21 09:11 +0200:
>does the installation of ZopeProfiler have a noticable performance
>impact when it is disabled?


"ZopeProfiler" monkey patches "ZPublisher.publish_module"
with the following function:

def _profilePublishModule(
  module_name, stdin=sys.stdin, stdout=sys.stdout, 
  stderr=sys.stderr, environ=environ, debug=0, 
  request=None, response=None
  lock= _lock # to facilitate refreshing
  psrc= request or environ; path= psrc.get('PATH_INFO')
  if _enabled and _doProfile(path):
     ... code only executed when the profiler is enabled ...
    result= publish_module(
                         module_name, stdin=stdin, stdout=stdout, 
                         stderr=stderr, environ=environ, debug=debug, 
                         request=request, response=response)
  return result

As you can see:

  The overhead when "ZopeProfiler" is disabled is

    * an extra function call

    * 3 assignments

    * a request lookup

    * a boolean check

In total: negligable compared to what the ZPublisher (not speaking 
about Zope at all) is doing otherwise.

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to