classification
Title: Optimize import this (patch to make it 10x faster)
Type: Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: barry, benjamin.peterson, georg.brandl, lemburg, pitrou, rhettinger, vstinner
Priority: release blocker Keywords: patch

Created on 2011-05-07 09:52 by vstinner, last changed 2011-05-07 19:51 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
python27_this_rot13.patch vstinner, 2011-05-07 09:52
bench.py vstinner, 2011-05-07 09:53
Messages (8)
msg135432 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-07 09:52
Patch to optimize this: make it 10 times faster.

Try attached benchmark script. On a debug build I got the following results:
 * original: 299.8 ms
 * patched: 23.2 ms

I expected a factor of 10 because it uses a C implementation of rot13 instead of an hand made Python implementation.
msg135433 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-07 09:56
Barry, 2.6?
msg135449 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2011-05-07 11:58
STINNER Victor wrote:
> 
> New submission from STINNER Victor <victor.stinner@haypocalc.com>:
> 
> Patch to optimize this: make it 10 times faster.
> 
> Try attached benchmark script. On a debug build I got the following results:
>  * original: 299.8 ms
>  * patched: 23.2 ms
> 
> I expected a factor of 10 because it uses a C implementation of rot13 instead of an hand made Python implementation.

It's a bit late for an April 1st patch, but +1 for the fun of it :-)
msg135456 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2011-05-07 12:28
That's a good one, but um, no not for 2.6, unless you can argue that a delay in obtaining the received wisdom of The Timbot is a serious security hole in Python.

Bag of ham.
msg135475 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-05-07 16:01
I suggest rejecting. See 8ae88db7843c
msg135476 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-05-07 16:08
(And subsequently cc10b010f40b.  I agree with Benjamin.)
msg135498 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-05-07 19:33
@Raymond: What do you think? Do you prefer simple or faster code?

I think that the speed of "import this" do matter!
msg135501 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-05-07 19:51
Move on, nothing to see here ;-)
History
Date User Action Args
2011-05-07 19:51:17rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg135501
2011-05-07 19:33:02vstinnersetmessages: + msg135498
2011-05-07 16:08:11georg.brandlsetnosy: + georg.brandl
messages: + msg135476
2011-05-07 16:01:58benjamin.petersonsetnosy: + rhettinger
2011-05-07 16:01:02benjamin.petersonsetmessages: + msg135475
2011-05-07 12:28:48barrysetmessages: + msg135456
2011-05-07 11:58:54lemburgsetmessages: + msg135449
2011-05-07 09:56:29pitrousetpriority: normal -> release blocker
nosy: + barry, benjamin.peterson
messages: + msg135433

2011-05-07 09:53:17vstinnersetnosy: + lemburg, pitrou
2011-05-07 09:53:05vstinnersetfiles: + bench.py
2011-05-07 09:52:54vstinnercreate