Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.053 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'skip:[ 20': 0.04; 'subject:Python': 0.06; '3.3,': 0.16; 'fiddle': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'import': 0.22; 'example.': 0.24; 'instance,': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'have,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'usually': 0.31; '3.2': 0.31; '>>>>': 0.31; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'possible': 0.36; 'example,': 0.37; 'received:209': 0.37; 'being': 0.38; 'server': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'called': 0.40; 'show': 0.63; 'production': 0.68; '600': 0.68; 'subject:long': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=qr/5eD1Xxk44cONAlNp0KCx63OY5R9ah1tjQ9j8vkz4=; b=WX6VPYD8/+CVvGrHa8JzKPqg3Yx7JiTd/kbuxKII7jB2U6MTCNYGT7unPDwUeMdYXj lZElD0Mx4Sb5bu9ebQ0C08oC2qnDjjynRWJ/2Q40MTkFyX4nfPsK0AwYD6NRDNSlMVIk ygSE5eqiYmH8EbjExzEkY8asWJeRRR7CE+yvF0/5tKmaihg3k8+DujKLSVkmN2DrDqsJ 1c6qRYHW1og4vN/tkGZL5Q6js8VC9h6Vm37ecmkz3T4GW7dUxzODs1kTrcyce2vd92Lc m03BC86R2TzZV2IP07jbaBhtsHUEAqOQuApl7iRUz+U2/421d814Vs52WH6zPv357etC X0EQ== MIME-Version: 1.0 X-Received: by 10.220.109.145 with SMTP id j17mr10239929vcp.34.1364844533575; Mon, 01 Apr 2013 12:28:53 -0700 (PDT) In-Reply-To: <4103dc28-a0dc-4740-bb38-b6bcb58bedfb@h1g2000vbx.googlegroups.com> References: <5153d313$0$29984$c3e8da3$5496439d@news.astraweb.com> <0b6be19c-ff11-4e24-a7dc-fec0af411393@kw7g2000pbb.googlegroups.com> <5153f5ce$0$29984$c3e8da3$5496439d@news.astraweb.com> <11ef1d36-0783-4cb2-b29f-9ae573ed7e47@googlegroups.com> <6a146aba-a032-4aac-b2d3-7acedcebd804@q3g2000pbv.googlegroups.com> <515941d8$0$29967$c3e8da3$5496439d@news.astraweb.com> <5159beb6$0$29967$c3e8da3$5496439d@news.astraweb.com> <4103dc28-a0dc-4740-bb38-b6bcb58bedfb@h1g2000vbx.googlegroups.com> Date: Tue, 2 Apr 2013 06:28:53 +1100 Subject: Re: Performance of int/long in Python 3 From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364844536 news.xs4all.nl 6924 [2001:888:2000:d::a6]:36157 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42487 On Tue, Apr 2, 2013 at 6:15 AM, jmfauth wrote: > Py32 >>>> import timeit >>>> timeit.repeat("'a' * 1000 + '=E1=BA=9E'") > [0.7005365263669056, 0.6810694766790423, 0.6811978680727229] >>>> timeit.repeat("'a' * 1000 + 'z'") > [0.7105829560031083, 0.6904999426964764, 0.6938637184431968] > > Py33 > import timeit > timeit.repeat("'a' * 1000 + '=E1=BA=9E'") > [1.1484035160337613, 1.1233738895227505, 1.1215708962703874] > timeit.repeat("'a' * 1000 + 'z'") > [0.6640958193635527, 0.6469043692851528, 0.6458961423900007] This is what's called a microbenchmark. Can you show me any instance in production code where an operation like this is done repeatedly, in a time-critical place? It's a contrived example, and it's usually possible to find regressions in any system if you fiddle enough with the example. Do you have, for instance, a web server that can handle 1000 tps on 3.2 and only 600 tps on 3.3, all other things being equal? ChrisA