Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.038 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'received:134': 0.05; 'bytes.': 0.09; '*never*': 0.16; 'immutable,': 0.16; 'somewhere.': 0.16; 'vastly': 0.16; 'xxx,': 0.16; 'producing': 0.19; 'starts': 0.20; 'fit': 0.20; '>>>': 0.22; 'coding': 0.22; 'header:User- Agent:1': 0.23; 'char': 0.24; 'somewhere': 0.26; 'header:In-Reply- To:1': 0.27; 'characters': 0.30; '>>>>': 0.31; 'skip:7 10': 0.31; 'skip:s 30': 0.35; 'something': 0.35; 'but': 0.35; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'impact': 0.61; 'course': 0.61; 'email addr:gmail.com': 0.63; 'happen': 0.63; 'charset:windows-1252': 0.65; 'results': 0.69; 'nonsense.': 0.84 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAO/F+FGGuA9G/2dsb2JhbABbwieBLoMYAQEEATIBRQYLCyEWDwkDAgECAQ82EwYCAod6AwkGr2oNV4gHjQ2CeBaDcwOVdoFphhCGFoUmgxY Date: Wed, 31 Jul 2013 10:11:10 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: RE Module Performance References: <4f1067f6-bc99-42ad-9166-37fb228b90e8@googlegroups.com> <51f14395$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f15e03$0$29971$c3e8da3$5496439d@news.astraweb.com> <8203e802-9dc5-44c5-9547-6e1947ee224b@googlegroups.com> <43ce1b65-9d6d-47dd-b209-9a3bbafc0b8c@googlegroups.com> <51F7CFD1.1090403@rece.vub.ac.be> <51F7E634.2030200@mrabarnett.plus.com> <51F7EC41.5010704@rece.vub.ac.be> <51F7F48F.3070803@mrabarnett.plus.com> <39155ddf-437c-459e-ad7c-dd841810a592@googlegroups.com> In-Reply-To: <39155ddf-437c-459e-ad7c-dd841810a592@googlegroups.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375258272 news.xs4all.nl 16004 [2001:888:2000:d::a6]:47799 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51630 Op 30-07-13 21:09, wxjmfauth@gmail.com schreef: > Matable, immutable, copyint + xxx, bufferint, O(n) .... > Yes, but conceptualy the reencoding happen sometime, somewhere. Which is a far cry from your previous claim that it happened every time you enter a char. This of course make your case harder to argue. Because the impact of something that happens sometime, somewhere is vastly less than something that happens everytime you enter a char. > The internal "ucs-2" will never automagically be transformed > into "ucs-4" (eg). It will just start producing wrong results when someone starts using characters that don't fit into ucs-2. >>>> timeit.timeit("'a'*10000 +'€'") > 7.087220684719967 >>>> timeit.timeit("'a'*10000 +'z'") > 1.5685214234430873 >>>> timeit.timeit("z = 'a'*10000; z = z +'€'") > 7.169538866162213 >>>> timeit.timeit("z = 'a'*10000; z = z +'z'") > 1.5815893830557286 >>>> timeit.timeit("z = 'a'*10000; z += 'z'") > 1.606955741596181 >>>> timeit.timeit("z = 'a'*10000; z += '€'") > 7.160483334521416 > > > And do not forget, in a pure utf coding scheme, your > char or a char will *never* be larger than 4 bytes. > >>>> sys.getsizeof('a') > 26 >>>> sys.getsizeof('\U000101000') > 48 Nonsense. >>> sys.getsizeof('a'.encode('utf-8')) 18