A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/021599.html below:

[Python-Dev] Re: PEP 282 comments

[Python-Dev] Re: PEP 282 commentsJeremy Hylton jeremy@zope.com
Thu, 21 Mar 2002 19:13:48 -0500
>>>>> "KB" == Kevin Butler <kbutler@campuspipeline.com> writes:

  KB> [Jeremy]
  >> Why do you need **kwargs at all?

  KB> So we can postpone formatting the optional arguments into a
  KB> message until after we test if we're going to log the message or
  KB> not.

Aha!  I must have gone out of my way to miss this.  This is certainly
a good thing.  In the case of the ZEO server, we put all the trace and
debug level logging calls inside "if __debug__:"  We see a 20% speedup
on compute intensive benchmarks when running with -O.  So avoiding the
string formatting is a nice savings.

On the other hand, extended calls -- where the caller passes *args or
**args -- are a lot slower than regular calls.  It would be
interesting to benchmark both approaches.  I expect that no-formatting
is faster, but wouldn't bet too much on it.  Apps probably still
benefit from exploting if __debug__.

Jeremy




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4