RE Module Performance

Antoon Pardon antoon.pardon at
Tue Jul 30 20:19:02 CEST 2013

Op 30-07-13 19:14, MRAB schreef:
> 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 at 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.

So? Why are you making this a point of discussion? I was not aware that
the pro and cons of various editor buffer implemantations was relevant
to the point I was trying to make.

If you prefer an other data structure in the editor you are working on,
I will not dissuade you.

Antoon Pardon

More information about the Python-list mailing list