Issue 12027: Optimize import this (patch to make it 10x faster) (original) (raw)

Created on 2011-05-07 09:52 by vstinner, last changed 2022-04-11 14:57 by admin. 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
2022-04-11 14:57:17 admin set github: 56236
2011-05-07 19:51:17 rhettinger set status: open -> closedresolution: rejectedmessages: +
2011-05-07 19:33:02 vstinner set messages: +
2011-05-07 16:08:11 georg.brandl set nosy: + georg.brandlmessages: +
2011-05-07 16:01:58 benjamin.peterson set nosy: + rhettinger
2011-05-07 16:01:02 benjamin.peterson set messages: +
2011-05-07 12:28:48 barry set messages: +
2011-05-07 11:58:54 lemburg set messages: +
2011-05-07 09:56:29 pitrou set priority: normal -> release blockernosy: + barry, benjamin.petersonmessages: +
2011-05-07 09:53:17 vstinner set nosy: + lemburg, pitrou
2011-05-07 09:53:05 vstinner set files: + bench.py
2011-05-07 09:52:54 vstinner create