ZopeProfiler:does its installation have a performance impact?
Hi there, does the installation of ZopeProfiler have a noticable performance impact when it is disabled? thanks robert
--On 21. September 2007 09:11:11 +0200 robert rottermann <robert@redcor.ch> wrote:
Hi there, does the installation of ZopeProfiler have a noticable performance impact when it is disabled?
No -aj
robert rottermann wrote at 2007-9-21 09:11 +0200:
does the installation of ZopeProfiler have a noticable performance impact when it is disabled?
No. "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 ... else: 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. -- Dieter
participants (3)
-
Andreas Jung -
Dieter Maurer -
robert rottermann