Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41199

Re: String performance regression from python 3.2 to 3.3

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'argument': 0.04; 'cpython': 0.05; 'startup': 0.05; 'ascii': 0.07; 'dev': 0.07; 'function,': 0.07; 'option,': 0.07; 'python': 0.09; '16-bit': 0.09; 'command-line': 0.09; 'exception,': 0.09; 'regression': 0.09; 'sure,': 0.09; 'switches': 0.09; 'thrown': 0.09; 'unexpectedly': 0.09; 'language,': 0.11; "wouldn't": 0.11; 'subject:python': 0.11; 'extension': 0.13; 'cases': 0.15; '3.2.': 0.16; 'buggy': 0.16; 'efficiency.': 0.16; 'encountered,': 0.16; 'executables': 0.16; 'expert,': 0.16; 'formats.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'graceful': 0.16; 'incomplete': 0.16; 'knock': 0.16; 'pairs': 0.16; 'plus,': 0.16; 'statement.': 0.16; 'subject:3.3': 0.16; 'subject:String': 0.16; 'thread.': 0.16; 'utterly': 0.16; 'whatever,': 0.16; 'wed,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'string,': 0.17; 'thu,': 0.17; 'unicode': 0.17; 'trying': 0.21; '3.2': 0.22; 'assumes': 0.22; "i'd": 0.22; 'this:': 0.23; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'common': 0.26; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'actual': 0.28; 'chris': 0.28; 'equivalent,': 0.29; 'factor': 0.29; 'character': 0.29; "i'm": 0.29; 'that.': 0.30; 'sense': 0.31; 'code': 0.31; 'system,': 0.32; 'support,': 0.32; 'switch': 0.32; 'builds': 0.33; 'doubt': 0.33; 'impression': 0.33; 'skip:j 20': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'wrong': 0.34; 'list': 0.35; 'compared': 0.35; 'pm,': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'characters': 0.36; 'useful': 0.36; 'should': 0.36; 'does': 0.37; 'two': 0.37; 'uses': 0.37; 'being': 0.37; 'quite': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'instead': 0.39; 'performance': 0.39; 'to:addr:python.org': 0.39; 'build': 0.39; 'space': 0.39; 'think': 0.40; 'skip:u 10': 0.60; 'most': 0.61; 'further': 0.61; 'personally': 0.61; 'stay': 0.61; 'back': 0.62; 'wide': 0.62; 'is.': 0.62; 'between': 0.63; 'worth': 0.63; 'more': 0.63; 'within': 0.64; 'replying': 0.64; 'making': 0.64; 'matter.': 0.65; 'readers': 0.65; 'theoretical': 0.65; 'unnecessary': 0.65; 'subject': 0.66; 'hours': 0.66; 'price': 0.66; 'talking': 0.66; "today's": 0.66; 'believe': 0.69; '2013': 0.84; 'choices:': 0.84; 'complexity': 0.84; 'cost,': 0.84; 'fourth': 0.84; 'hardly': 0.84; "it'd": 0.84; 'python-dev': 0.84; 'inefficient': 0.91; 'rusi': 0.91
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; bh=nbZxoxAJ+iw4t8OU84kVmBIcpWcTb9UFhLevtRLv52U=; b=CKkD0O/gRog/IjttSkXtu8ahohcWRrmXl8i1LK/lgTQXxDAmNDeFtgJM4rTAY3rT/S 3KDuk60XADJcDVB+BE2jcCZs7wgcaJTMw4K/p2tx0TLZL8IzsdMr7g3lHpPzWN9VZjLz 877mDpKjCnxPrEBNgp/Tto5zmOwxA7YqHpz1o+ctjxZYcD+uqANiLlecNyE6cMmAstet e4QU7U47OP/XnKMTffYAaXm/hnGAOY3oZQoZ6aeYK0nRkLBFEMqMY6I/7I7Yk9jlSMEZ Yl55drjFMrx+9cGquBbTaCWyd5+s1v21zINnlZJU5OVczCzIAALvaFXj7ztZs/PE+3vL OA2Q==
MIME-Version 1.0
X-Received by 10.220.109.145 with SMTP id j17mr117411vcp.34.1363218238828; Wed, 13 Mar 2013 16:43:58 -0700 (PDT)
In-Reply-To <ee2062d1-658a-4bf5-8a56-5fe9c0991bef@o9g2000pbt.googlegroups.com>
References <23a42297-9262-4ace-87ad-138999b1ddd6@z3g2000vbg.googlegroups.com> <a1a6394a-e9c7-407b-9f6d-ff44de1b65de@y2g2000pbg.googlegroups.com> <eabe27a9-099a-4e2c-92fb-bdf3819c2561@kw7g2000pbb.googlegroups.com> <mailman.3259.1363172350.2939.python-list@python.org> <ee2062d1-658a-4bf5-8a56-5fe9c0991bef@o9g2000pbt.googlegroups.com>
Date Thu, 14 Mar 2013 10:43:58 +1100
Subject Re: String performance regression from python 3.2 to 3.3
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3274.1363218247.2939.python-list@python.org> (permalink)
Lines 60
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1363218247 news.xs4all.nl 6924 [2001:888:2000:d::a6]:57958
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41199

Show key headers only | View raw


On Thu, Mar 14, 2013 at 3:49 AM, rusi <rustompmody@gmail.com> wrote:
> On Mar 13, 3:59 pm, Chris Angelico <ros...@gmail.com> wrote:
>> On Wed, Mar 13, 2013 at 9:11 PM, rusi <rustompm...@gmail.com> wrote:
>> > Uhhh..
>> > Making the subject line useful for all readers
>>
>> I should have read this one before replying in the other thread.
>>
>> jmf, I'd like to see evidence that there has been a performance
>> regression compared against a wide build of Python 3.2. You still have
>> never answered this fundamental, that the narrow builds of Python are
>> *BUGGY* in the same way that JavaScript/ECMAScript is. And believe you
>> me, the utterly unnecessary hassles I have had to deal with when
>> permitting user-provided .js code to script my engine have wasted
>> rather more dev hours than you would believe - there are rather a lot
>> of stupid edge cases to deal with.
>
> 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.
>
> 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.

As a simple factual matter, narrow builds of Python 3.2 don't do that.
So it doesn't factor into my original statement. But if you're talking
about a proposal for 3.4, then sure, that's a theoretical possibility.
It wouldn't be "buggy" in the sense of "string indexing/slicing
unexpectedly does the wrong thing", but it would still be incomplete
Unicode support, and I don't think people would appreciate it. Much
better to have graceful degradation: if there are non-BMP characters
in the string, then instead of throwing an exception, it just makes
the string wider.

> I am hardly a unicode expert, my impression is this: While in today's
> internationalized world, going back to ASCII is not an option, most
> actual uses of unicode stay within the BMP

That's a valid line of argument for an optimization, but not for a
hard limitation. A general-purpose language, function, system,
whatever, will need to cope with astral characters at some point; it
just won't need them *often*.

> Further if the choice is not between two python executables but
> between string-engines chosen at startup by command-line switches or
> equivalent, the price may be quite small.

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. :)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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