On 8/30/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Fredrik Lundh wrote:
>
> > not necessarily, but there are lots of issues involved when doing
> > high-performance XML stuff, and I'm not sure views would help quite as
> > much as one might think.
> >
> > (writing and tuning cET was a great way to learn that not everything
> > that you think you know about C performance applies to C code running
> > inside the Python interpreter...)
>
> and also based on the cET (and NFS) experiences, it wouldn't surprise me
> if a naive 32-bit text string implementation will, on average, slow things 
> down
> *more* than any string view implementation can speed things up again...
>
> (in other words, I'm convinced that we need a polymorphic string type.  I'm 
> not
> so sure we need views, but if we have the former, we can use that mechanism to
> support the latter)

+1 for polymorphic strings.

This would give us the best of both worlds: compact representations
for ASCII and Latin-1, full 32-bit text when needed, and the
possibility to implement further optimizations when necessary. It
could add a bit of complexity and/or a massive speed penalty
(depending on how naive the implementation is) around character
operations though.

For implementation ideas, Apple's CoreFoundation has a mature
implementation of polymorphic strings in C (which is the basis for
their NSString type in Objective-C), and there's a cross-platform
subset of it available as CF-Lite:
http://developer.apple.com/opensource/cflite.html

-bob
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to