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/2006-May/065148.html below:

[Python-Dev] 2.5a2 try/except slow-down: Convert to type?

[Python-Dev] 2.5a2 try/except slow-down: Convert to type? [Python-Dev] 2.5a2 try/except slow-down: Convert to type?Michael Hudson mwh at python.net
Wed May 24 12:36:52 CEST 2006
Sean Reifschneider <jafo-python-dev at tummy.com> writes:

> We're working at the sprint on tracking this down.  I want to provide some
> history first and then what we're looking for feedback on.
>
> Steve Holden found this on Sunday, the pybench try/except test shows a ~60%
> slowdown from 2.4.3 to 2.5a2.  The original test is, roughly:
>
>    for i in range(N):
>       try: raise ValueError, 'something'
>       except: pass
>
> But changing it to the following shows 0% slowdown from 2.4.3 to 2.5a2:
>
>    e = ValueError('something')
>    for i in range(N):
>       try: raise e
>       except: pass
>
> The change is that from 2.4.3 to 2.5a2 includes Brett Cannon's patch to make
> exceptions all new-style objects.

Could it just be that instantiating instances of new-style classes is
slower than instantiating instances of old-style classes?  There's not
anything in what you've posted to suggest that exceptions are involved
directly.

Cheers,
mwh

-- 
  Get out your salt shakers folks, this one's going to take more
  than one grain.                 -- Ator in an Ars Technica news item
More information about the Python-Dev mailing list

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