Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'cpython': 0.05; 'python': 0.09; '16-bit': 0.09; 'does,': 0.09; 'indicates': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tcl/tk': 0.09; 'terry': 0.09; 'thrown': 0.09; 'subject:python': 0.11; 'extension': 0.13; 'buggy': 0.16; 'efficiency.': 0.16; 'encountered,': 0.16; 'formats.': 0.16; 'knock': 0.16; 'pairs': 0.16; 'plus,': 0.16; 'presume': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:3.3': 0.16; 'subject:String': 0.16; 'string': 0.17; 'wrote:': 0.17; 'certainly': 0.17; 'thu,': 0.17; 'jan': 0.18; 'previously': 0.18; 'trying': 0.21; 'assumes': 0.22; 'runs': 0.22; "python's": 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'developers': 0.26; 'common': 0.26; 'am,': 0.27; 'header:X-Complaints-To:1': 0.28; 'chris': 0.28; 'once.': 0.29; 'character': 0.29; "i'm": 0.29; 'switch': 0.32; 'doubt': 0.33; 'to:addr:python-list': 0.33; 'list': 0.35; 'faster': 0.35; 'pm,': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'too': 0.36; 'problems': 0.36; 'being': 0.37; 'busy': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'build': 0.39; 'space': 0.39; 'header:Received:5': 0.40; 'real': 0.61; 'personally': 0.61; 'interest': 0.62; 'wide': 0.62; 'worth': 0.63; 'more': 0.63; 'matter.': 0.65; '2013': 0.84; 'choices:': 0.84; 'complexity': 0.84; 'cost,': 0.84; 'fourth': 0.84; "it'd": 0.84; 'python-dev': 0.84; 'received:fios.verizon.net': 0.84; 'inefficient': 0.91; 'rusi': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: String performance regression from python 3.2 to 3.3 Date: Wed, 13 Mar 2013 22:35:44 -0400 References: <23a42297-9262-4ace-87ad-138999b1ddd6@z3g2000vbg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363228557 news.xs4all.nl 6849 [2001:888:2000:d::a6]:59207 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41207 On 3/13/2013 7:43 PM, Chris Angelico wrote: > On Thu, Mar 14, 2013 at 3:49 AM, rusi wrote: > >> This assumes that there are only three choices: >> - narrow build that is buggy (surrogate pairs for astral characters) >> - wide build that is 4-fold space inefficient for wide variety of >> common (ASCII) use-cases >> - flexible string engine that chooses a small tradeoff of space >> efficiency over time efficiency. Wrong. Python almost certainly runs faster with the new string representation. This has been explained previously more than once. >> There is a fourth choice: narrow build that chooses to be partial over >> being buggy. ie when an astral character is encountered, an exception >> is thrown rather than trying to fudge it into a 16-bit >> representation. This is what tcl/tk does, and it is a dammed nuisance. Completely unacceptible for Python's string type. ... > It's complexity cost, though, and people would need to know when it > would be worth giving Python that switch to change its string format. > Plus, every C extension would need to cope with both formats. I > personally doubt it'd be worth it, but if you want to knock together a > patched CPython and get some timing stats, I'm sure this list or > python-dev will be happy to discuss the matter. :) I presume the smiley indicates that you know that python developers are too busy with real problems to have any interest in bogus solutions to bogus problems. -- Terry Jan Reedy