From: Larry M. <lm...@bi...> - 2012-11-24 04:02:22
|
On Fri, Nov 23, 2012 at 10:35:42PM -0500, Kevin Kenny wrote: > On 11/23/2012 09:45 PM, Larry McVoy wrote: > >>> If that is the direction then I'd beg for two string types, unicode and > >>> not. Tcl could be kick ass fast if unicode was optional. > >> > >> You keep harping on that, and it's just not quite true. > >> Tcl is slower than it needs to be, because of all the conversion > >> back and forth between UTF-8 (CESU-8, actually) and UCS-2 that it > >> does. That has to be revisited sometime fairly soon anyway, if we're > >> to break the BMP barrier. If we can get [string index] (and > >> [string range] and friends), and [regexp] working on UTF-8 - which > >> ought to be possible with a little bit of auxiliary indexing > >> in place of the UCS-2 representation - then a lot of that disappears. > >> > >> (And I repeat myself: your examples should be using byte arrays.) > > > > OK, I might be wrong. Can you write a cat(1) ans a grep(1) clone in > > tcl that outperforms perl? > > > > No. Because the problems that I mentioned above aren't fixed, and > will need Novem to fix them. And for plain 'cat'. Tcl's I/O layer still > has one extra buffer copy that has nothing to do with Unicode. Buffer copies are not the problem. Modern systems bcopy at ~10GB/sec or better. Tcl is nowhere near that. > But you knew that. I did? -- --- Larry McVoy lm at bitmover.com http://www.bitkeeper.com |