[Python-Dev] Support for "wide" Unicode characters

Neil Hodgson nhodgson@bigpond.net.au
Mon, 2 Jul 2001 13:00:41 +1000


Tim Peters:

> Well, they still do -- fancy editors use fancy data structures, so that,
> e.g., inserting characters at the start of the file doesn't cause a 50Mb
> memmove each time.  Response time is still important, but I'd wager
> relatively insensitive to basic character size (you need tricks that cut
> factors of 1000s off potential worst cases to give the appearance of
> instantaneous results; a factor of 2 or 4 is in the noise compared to
what's
> needed regardless).

   I actually have some numbers here. Early versions of some new editor
buffer code used UCS-2 on .NET and the JVM. Moving to an 8 bit buffer saved
10-20% of execution time on the insert string, delete string and global
replace benchmarks using strings that fit into ASCII. These buffers did have
some other overhead for line management and other features but I expect
these did not affect the proportions much.

   Neil