Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder3.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:How': 0.09; 'python': 0.09; 'handling,': 0.09; 'subject:()': 0.09; 'subject:string': 0.09; 'subject:using': 0.09; 'cc:addr:python- list': 0.10; 'aug': 0.13; 'sat,': 0.15; '3.2.': 0.16; 'bug:': 0.16; 'measurement': 0.16; 'skip:n 50': 0.16; 'snippets': 0.16; 'subject: \n ': 0.16; 'subject:unicode': 0.16; 'subject:variable': 0.16; 'string': 0.17; 'wrote:': 0.17; 'windows': 0.19; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'url:bugs': 0.24; 'command': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'wrote': 0.26; '2.3': 0.27; '-0700,': 0.29; 'factor': 0.29; 'code': 0.31; 'url:python': 0.32; 'running': 0.32; 'compared': 0.35; 'pm,': 0.35; 'url:org': 0.36; 'operating': 0.36; 'subject:: ': 0.38; 'performance': 0.39; 'system.': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'close': 0.63; '10000': 0.65; 'laptop': 0.66; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; '100%': 0.76; 'replicate': 0.84; 'subject:value': 0.84; 'average': 0.93 Date: Sun, 19 Aug 2012 14:05:48 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Blind Anagram Subject: Re: How do I display unicode value stored in a string variable using ord() References: <308df2af-abe7-4043-b199-0a39f440e0ab@googlegroups.com> <502f8a2a$0$29978$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:fKdMMmmFeehofwnF2aE5F/Zcds/rBb/q9tCKhYBUVFL drH8vrpiOyP7r3adimYiyiuh115go0vvtDhjCajiIwtSycT9W5 6YIAWqaJAIUwGi93eaDqggX5SHU1AqoYr3S7lP6EmrawPXiEqO 8kbpgGu3vPXRbew5ggu+dhHwW1/0C+6bwvZwuDnM8tpX9J97kK sYBRQlfPhIyx0AdJm4vN3BxAPbVAE4jV0tIC0/uBnNjgmOyClK C7XOFTntbIwd4Nwx9g8mUQatv/TiGjEP2H2WDwa/vmgtQZqgd1 1VONcxFdSKrNx9ZHeS7/AW8fbhQ5MCn2ua22XL3h9BMsxG3fA= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345399574 news.xs4all.nl 6882 [2001:888:2000:d::a6]:56745 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27415 On 08/19/2012 01:03 PM, Blind Anagram wrote: > "Steven D'Aprano" wrote in message > news:502f8a2a$0$29978$c3e8da3$5496439d@news.astraweb.com... > > On Sat, 18 Aug 2012 01:09:26 -0700, wxjmfauth wrote: > > [...] > If you can consistently replicate a 100% to 1000% slowdown in string > handling, please report it as a performance bug: > > http://bugs.python.org/ > > Don't forget to report your operating system. > > ==================================================== > For interest, I ran your code snippets on my laptop (Intel core-i7 > 1.8GHz) running Windows 7 x64. > > Running Python from a Windows command prompt, I got the following on > Python 3.2.3 and 3.3 beta 2: > > python33\python" -m timeit "('abc' * 1000).replace('c', 'de')" > 10000 loops, best of 3: 39.3 usec per loop > python33\python" -m timeit "('ab…' * 1000).replace('…', '……')" > 10000 loops, best of 3: 51.8 usec per loop > python33\python" -m timeit "('ab…' * 1000).replace('…', 'x…')" > 10000 loops, best of 3: 52 usec per loop > python33\python" -m timeit "('ab…' * 1000).replace('…', 'œ…')" > 10000 loops, best of 3: 50.3 usec per loop > python33\python" -m timeit "('ab…' * 1000).replace('…', '€…')" > 10000 loops, best of 3: 51.6 usec per loop > python33\python" -m timeit "('XYZ' * 1000).replace('X', 'éç')" > 10000 loops, best of 3: 38.3 usec per loop > python33\python" -m timeit "('XYZ' * 1000).replace('Y', 'p?')" > 10000 loops, best of 3: 50.3 usec per loop > > python32\python" -m timeit "('abc' * 1000).replace('c', 'de')" > 10000 loops, best of 3: 24.5 usec per loop > python32\python" -m timeit "('ab…' * 1000).replace('…', '……')" > 10000 loops, best of 3: 24.7 usec per loop > python32\python" -m timeit "('ab…' * 1000).replace('…', 'x…')" > 10000 loops, best of 3: 24.8 usec per loop > python32\python" -m timeit "('ab…' * 1000).replace('…', 'œ…')" > 10000 loops, best of 3: 24 usec per loop > python32\python" -m timeit "('ab…' * 1000).replace('…', '€…')" > 10000 loops, best of 3: 24.1 usec per loop > python32\python" -m timeit "('XYZ' * 1000).replace('X', 'éç')" > 10000 loops, best of 3: 24.4 usec per loop > python32\python" -m timeit "('XYZ' * 1000).replace('Y', 'p?')" > 10000 loops, best of 3: 24.3 usec per loop > > This is an average slowdown by a factor of close to 2.3 on 3.3 when > compared with 3.2. > Using your measurement numbers, I get an average of 1.95, not 2.3 -- DaveA