Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41285
| From | Andriy Kornatskyy <andriy.kornatskyy@live.com> |
|---|---|
| Subject | RE: String performance regression from python 3.2 to 3.3 |
| Date | 2013-03-15 21:04 +0300 |
| References | <4eb54568-3135-4e81-9784-ff3ed989916b@mz7g2000pbb.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3349.1363370733.2939.python-list@python.org> (permalink) |
$ python3.2
Python 3.2.3 (default, Jun 25 2012, 22:55:05)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from timeit import repeat
>>> repeat("s=s[:-1]+'\u0034'","s='asdf'*10000",number=10000)
[0.2566258907318115, 0.14485502243041992, 0.14464998245239258]
>>> repeat("s=s[:-1]+'\u1234'","s='asdf'*10000",number=10000)
[0.25584888458251953, 0.1340939998626709, 0.1338820457458496]
>>> repeat("s=s[:-1]+'\u1234'","s='\u1234sdf'*10000",number=10000)
[0.2571289539337158, 0.13403892517089844, 0.13388800621032715]
>>> repeat("s=s[:-1]+'\U00012345'","s='asdf'*10000",number=10000)
[0.5022759437561035, 0.3970041275024414, 0.3764481544494629]
>>> repeat("s=s[:-1]+'\U00012345'","s='\u1234sdf'*10000",number=10000)
[0.5213770866394043, 0.38585615158081055, 0.40251588821411133]
>>> repeat("s=s[:-1]+'\U00012345'","s='\U00012345sdf'*10000",number=10000)
[0.768744945526123, 0.5852570533752441, 0.6029140949249268]
$ python3.3
Python 3.3.0 (default, Sep 29 2012, 15:35:49)
[GCC 4.7.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from timeit import repeat
>>> repeat("s=s[:-1]+'\u0034'","s='asdf'*10000",number=10000)
[0.0985728640225716, 0.0984080360212829, 0.07457763599813916]
>>> repeat("s=s[:-1]+'\u1234'","s='asdf'*10000",number=10000)
[0.901988381985575, 0.7517840950167738, 0.7540924890199676]
>>> repeat("s=s[:-1]+'\u1234'","s='\u1234sdf'*10000",number=10000)
[0.3069786810083315, 0.17701858800137416, 0.1769046070112381]
>>> repeat("s=s[:-1]+'\U00012345'","s='asdf'*10000",number=10000)
[1.081760977016529, 0.9099628589756321, 0.9926943230093457]
>>> repeat("s=s[:-1]+'\U00012345'","s='\u1234sdf'*10000",number=10000)
[1.2101859120011795, 1.1039280130062252, 0.9306247030035593]
>>> repeat("s=s[:-1]+'\U00012345'","s='\U00012345sdf'*10000",number=10000)
[0.4759294819959905, 0.35435649199644104, 0.3540659479913302]
----------------------------------------
> Date: Fri, 15 Mar 2013 10:07:48 -0700
> Subject: Re: String performance regression from python 3.2 to 3.3
> From: rustompmody@gmail.com
> To: python-list@python.org
>
> 3.2 and 2.7 results on my desktop using Chris examples
> (Hope I cut-pasted them correctly)
> -----------------------------
> Welcome to the Emacs shell
>
> ~ $ python3
> Python 3.2.3 (default, Feb 20 2013, 17:02:41)
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from timeit import timeit
> >>> timeit("s=s[:-1]+'\u0034'","s='asdf'*10000",number=10000)
> 0.2893378734588623
> >>> timeit("s=s[:-1]+'\u1234'","s='asdf'*10000",number=10000)
> 0.2842249870300293
>
> >>> timeit("s=s[:-1]+'\u1234'","s='\u1234sdf'*10000",number=10000)
> 0.28406381607055664
> >>> timeit("s=s[:-1]+'\U00012345'","s='asdf'*10000",number=10000)
> 0.28420209884643555
> >>> timeit("s=s[:-1]+'\U00012345'","s='\u1234sdf'*10000",number=10000)
> 0.2853250503540039
> >>> timeit("s=s[:-1]+'\U00012345'","s='\U00012345sdf'*10000",number=10000)
> 0.283905029296875
> >>>
>
> ~ $ python
> Python 2.7.3 (default, Jan 2 2013, 16:53:07)
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from timeit import timeit
> >>> timeit("s=s[:-1]+'\u0034'","s='asdf'*10000",number=10000)
> 0.20418286323547363
> >>> timeit("s=s[:-1]+'\u1234'","s='asdf'*10000",number=10000)
>
> 0.20579099655151367
> >>> timeit("s=s[:-1]+'\u1234'","s='\u1234sdf'*10000",number=10000)
> 0.5055279731750488
> >>> timeit("s=s[:-1]+'\U00012345'","s='asdf'*10000",number=10000)
> 0.28449511528015137
> >>> timeit("s=s[:-1]+'\U00012345'","s='\u1234sdf'*10000",number=10000)
> 0.6001529693603516
> >>> timeit("s=s[:-1]+'\U00012345'","s='\U00012345sdf'*10000",number=10000)
> 0.8430721759796143
> --
> http://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A reply for rusi (FSR) jmfauth <wxjmfauth@gmail.com> - 2013-03-13 02:36 -0700
Re: A reply for rusi (FSR) rusi <rustompmody@gmail.com> - 2013-03-13 03:07 -0700
String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-13 03:11 -0700
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-13 21:59 +1100
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-13 09:49 -0700
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-14 10:43 +1100
Re: String performance regression from python 3.2 to 3.3 MRAB <python@mrabarnett.plus.com> - 2013-03-14 00:52 +0000
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-14 11:55 +1100
Re: String performance regression from python 3.2 to 3.3 MRAB <python@mrabarnett.plus.com> - 2013-03-14 02:01 +0000
Re: String performance regression from python 3.2 to 3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-14 04:05 +0000
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-14 17:47 +1100
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-14 03:48 -0700
Re: String performance regression from python 3.2 to 3.3 Terry Reedy <tjreedy@udel.edu> - 2013-03-14 19:14 -0400
Re: String performance regression from python 3.2 to 3.3 Terry Reedy <tjreedy@udel.edu> - 2013-03-14 20:48 -0400
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-15 10:07 -0700
RE: String performance regression from python 3.2 to 3.3 Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2013-03-15 21:04 +0300
Re: String performance regression from python 3.2 to 3.3 Terry Reedy <tjreedy@udel.edu> - 2013-03-13 22:35 -0400
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-14 17:21 +1100
Re: String performance regression from python 3.2 to 3.3 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-13 18:42 +0100
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-14 11:19 +1100
Re: String performance regression from python 3.2 to 3.3 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-16 03:44 +0100
Re: String performance regression from python 3.2 to 3.3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-16 03:56 +0000
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-15 21:26 -0700
Re: String performance regression from python 3.2 to 3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-16 08:47 +0000
Re: String performance regression from python 3.2 to 3.3 Neil Hodgson <nhodgson@iinet.net.au> - 2013-03-17 09:00 +1100
Re: String performance regression from python 3.2 to 3.3 Roy Smith <roy@panix.com> - 2013-03-16 18:10 -0400
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-16 14:59 +1100
Re: String performance regression from python 3.2 to 3.3 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-16 05:12 +0100
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-16 15:20 +1100
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-15 22:21 -0700
Re: String performance regression from python 3.2 to 3.3 Chris Angelico <rosuav@gmail.com> - 2013-03-16 15:09 +1100
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-15 21:35 -0700
Re: String performance regression from python 3.2 to 3.3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-03-16 04:56 +0000
Re: String performance regression from python 3.2 to 3.3 Terry Reedy <tjreedy@udel.edu> - 2013-03-16 01:05 -0400
Re: String performance regression from python 3.2 to 3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-16 05:38 +0000
Re: String performance regression from python 3.2 to 3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-16 05:25 +0000
Re: String performance regression from python 3.2 to 3.3 Roy Smith <roy@panix.com> - 2013-03-16 09:29 -0400
Re: String performance regression from python 3.2 to 3.3 rusi <rustompmody@gmail.com> - 2013-03-16 09:39 -0700
Re: String performance regression from python 3.2 to 3.3 Roy Smith <roy@panix.com> - 2013-03-16 14:00 -0400
Re: String performance regression from python 3.2 to 3.3 jmfauth <wxjmfauth@gmail.com> - 2013-03-16 13:42 -0700
Re: A reply for rusi (FSR) Chris Angelico <rosuav@gmail.com> - 2013-03-13 21:32 +1100
csiph-web