Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.054 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'root': 0.05; 'string': 0.09; 'ascii': 0.09; 'immutable': 0.09; 'repeated': 0.09; 'typed': 0.09; 'python': 0.11; 'character.': 0.16; 'hypothetical': 0.16; 'implies': 0.16; 'operation.': 0.16; 'demonstrate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'implementing': 0.19; 'email addr:gmail.com>': 0.22; 'char': 0.24; 'driven': 0.24; 'sorry,': 0.24; 'posts': 0.26; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'character': 0.29; 'tim': 0.29; 'waste': 0.30; 'message- id:@mail.gmail.com': 0.30; 'overhead': 0.31; 'anyone': 0.31; 'to:name:python-list': 0.33; 'copying': 0.34; 'editor': 0.35; 'operations': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'doing': 0.36; 'wrong': 0.37; 'performance': 0.37; 'focused': 0.38; 'others.': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'above,': 0.60; 'removing': 0.60; 'new': 0.61; 'entire': 0.61; 'you.': 0.62; 'times': 0.62; 'complete': 0.62; 'show': 0.63; 'soon': 0.63; 'july': 0.63; 'interest': 0.64; 'situation': 0.65; 'here': 0.66; 'surprise': 0.74; 'characters,': 0.84; 'insane': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=yx2q75S7o2g3bJmnkT8klT9xJrZ3HJfJHXwpAaecJUM=; b=IgNPW/qfMsI8en5Z6uI/rMqQ+fxPzFec3+Kn/aZVaRwwoaAAFiDCWgtHKk6+2u7r0w Kl5I1L1aasebcnv0OAeM0qAT2YtgB+KYrIziCi6I/xgFTrRzn2GbEZvmNvX4ly8nlV15 U3CpWxHgB6QlSHKcVOUPIuK2iITAKDRa2VRUsw1QMgM/J78qdtBdkQG9vZStukTbOP1z UL30PeQwjZgO7+6ksiHS7MZk1AL01sAT55f9lQGpaQnxsqj+e7CYt/qF6dCqLHAkD6jQ DjdncfmjkuIGcHKM0rQBfwwKMywsndljJ54YrRQ5PzVPxAveW0o1hPjnjPmZ01cYsC5b BEdQ== MIME-Version: 1.0 X-Received: by 10.182.72.137 with SMTP id d9mr56653301obv.99.1375205223676; Tue, 30 Jul 2013 10:27:03 -0700 (PDT) In-Reply-To: <43ce1b65-9d6d-47dd-b209-9a3bbafc0b8c@googlegroups.com> References: <571a6dfe-fd66-42cf-92fc-8b97cbe6e9e4@googlegroups.com> <51DFDE65.5040001@Gmail.com> <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> Date: Wed, 31 Jul 2013 03:27:03 +1000 Subject: Re: RE Module Performance From: Tim Delaney To: Python-List Content-Type: multipart/alternative; boundary=001a11c2ea24d9c50304e2bdea2a 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: 87 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375205232 news.xs4all.nl 15957 [2001:888:2000:d::a6]:51779 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51587 --001a11c2ea24d9c50304e2bdea2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 31 July 2013 00:01, wrote: > > I am pretty sure that once you have typed your 127504 > ascii characters, you are very happy the buffer of your > editor does not waste time in reencoding the buffer as > soon as you enter an =E2=82=AC, the 125505th char. Sorry, I wanted > to say z instead of euro, just to show that backspacing the > last char and reentering a new char implies twice a reencoding. > And here we come to the root of your complete misunderstanding and mischaracterisation of the FSR. You don't appear to understand that strings in Python are immutable and that to add a character to an existing string requires copying the entire string + new character. In your hypothetical situation above, you have already performed 127504 copy + new character operations before you ever get to a single widening operation. The overhead of the copy + new character repeated 127504 times dwarfs the overhead of a single widening operation. Given your misunderstanding, it's no surprise that you are focused on microbenchmarks that demonstrate that copying entire strings and adding a character can be slower in some situations than others. When the only use case you have is implementing the buffer of an editor using an immutable string I can fully understand why you would be concerned about the performance of adding and removing individual characters. However, in that case *you're focused on the wrong problem*. Until you can demonstrate an understanding that doing the above in any language which has immutable strings is completely insane you will have no credibility and the only interest anyone will pay to your posts is refuting your FUD so that people new to the language are not driven off by you. Tim Delaney --001a11c2ea24d9c50304e2bdea2a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 31 July 2013 00:01, <wxjmfauth@gmail.com> wrote:

I am pretty sure that once you have typed your 127504
ascii characters, you are very happy the buffer of your
editor does not waste time in reencoding the buffer as
soon as you enter an =E2=82=AC, the 125505th char. Sorry, I wanted
to say z instead of euro, just to show that backspacing the
last char and reentering a new char implies twice a reencoding.

And here we come to the root of your complete= misunderstanding and
mischaracterisation of the FSR. You don'= ;t appear to understand that
strings in Python are immutable and that to add a character to an
existing string requires copying the entire string + new character. I= n
your hypothetical situation above, you have already performed 1= 27504
copy + new character operations before you ever get to a single wideni= ng
operation. The overhead of the copy + new character repeated 1= 27504
times dwarfs the overhead of a single widening operation.

Given your misunderstanding, it's no surprise that = you are focused on
microbenchmarks that demonstrate that copying = entire strings and adding
a character can be slower in some situa= tions than others. When the only
use case you have is implementing the buffer of an editor using an
immutable string I can fully understand why you would be concerned a= bout
the performance of adding and removing individual characters= . However,
in that case *you're focused on the wrong problem*.

=
Until you can demonstrate an understanding that doing the above = in any
language which has immutable strings is completely insane = you will have
no credibility and the only interest anyone will pay to your posts is<= /div>
refuting your FUD so that people new to the language are not driv= en off
by you.

Tim Delaney=C2=A0
--001a11c2ea24d9c50304e2bdea2a--