On 04/02/2016 22:53, Marvin Humphrey wrote:
It may still be possible to optimize Clownfish-Python string conversion,
though.  We'll have to allocate all Clownfish strings on the heap, but they
can still wrap string content from a Python string.

Python strings are immutable, so as long as the Clownfish String holds a
refcount open on a Python string, it can wrap the UTF-8 string buffer obtained
via `PyUnicode_AsUTF8AndSize`:

Or we add support for additional encodings to Clownfish::String. Then we should be able to use Python string buffers directly without conversion to UTF-8. Support for multiple encodings shouldn't be too hard to implement, now that our String API is mostly based on iterators.

Implementing this optimization would require changes to String's internals.
For the time being, I intend to just copy all string content and leave this
optimization as a TODO.

I agree that this optimization isn't a priority.

Nick

Reply via email to