Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'mrab': 0.05; 'string': 0.09; 'ascii': 0.09; 'cursor': 0.09; 'insertion': 0.09; 'typed': 0.09; 'python': 0.11; '18:13,': 0.16; 'buffer.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'implies': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'char': 0.24; 'sorry,': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'characters': 0.30; 'waste': 0.30; '>>>>': 0.31; 'editor': 0.35; 'there': 0.35; 'example,': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'bad': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'around.': 0.60; 'new': 0.61; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'show': 0.63; 'soon': 0.63; 'charset:windows-1252': 0.65; 'header :Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'characters,': 0.84; 'gap': 0.84; 'pardon': 0.84; 'reply- to:addr:python.org': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=KrN0hwmN c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=K2DDQYBT4xIA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=N659UExz7-8A:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=-vha-_sxYaMA:10 a=pGLkceISAAAA:8 a=Qzbuctd-PqlUO9JW7uoA:9 a=pILNOxqGKmIA:10 a=MSl-tDqOz04A:10 X-AUTH: mrabarnett:2500 Date: Tue, 30 Jul 2013 18:14:55 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: RE Module Performance 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> <51F7CFD1.1090403@rece.vub.ac.be> <51F7E634.2030200@mrabarnett.plus.com> <51F7EC41.5010704@rece.vub.ac.be> In-Reply-To: <51F7EC41.5010704@rece.vub.ac.be> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375204498 news.xs4all.nl 15867 [2001:888:2000:d::a6]:47943 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51586 On 30/07/2013 17:39, Antoon Pardon wrote: > Op 30-07-13 18:13, MRAB schreef: >> On 30/07/2013 15:38, Antoon Pardon wrote: >>> Op 30-07-13 16:01, wxjmfauth@gmail.com schreef: >>>> >>>> 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 €, 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. >>> >>> Using a single string as an editor buffer is a bad idea in python for >>> the simple reason that strings are immutable. >> >> Using a single string as an editor buffer is a bad idea in _any_ >> language because an insertion would require all the following >> characters to be moved. > > Not if you use a gap buffer. > The disadvantage there is that when you move the cursor you must move characters around. For example, what if the cursor was at the start and you wanted to move it to the end? Also, when the gap has been filled, you need to make a new one.