Re: [pypy-dev] UTF8 string passing in cffi and PyPy internal string optimizations

2015-03-21 Thread Armin Rigo
Hi, On 18 March 2015 at 15:49, Amaury Forgeot d'Arc wrote: > 2015-03-17 18:27 GMT+01:00 Eleytherios Stamatogiannakis : >> Right now when PyPy receives a utf8 string (from a C function) it has to >> do 2 copies: >> >> 1. convert the cdata string to a pypy byte string via ffi.string >> 2. convert f

Re: [pypy-dev] UTF8 string passing in cffi and PyPy internal string optimizations

2015-03-18 Thread Amaury Forgeot d'Arc
Hi, 2015-03-17 18:27 GMT+01:00 Eleytherios Stamatogiannakis : > Hello, > > I'm sending the following here as they involve both cffi and PyPy. > > For the last few years i have been trying to find the most efficient way > to pass UTF8 strings between PyPy and C code using cffi. > > Right now when

[pypy-dev] UTF8 string passing in cffi and PyPy internal string optimizations

2015-03-17 Thread Eleytherios Stamatogiannakis
Hello, I'm sending the following here as they involve both cffi and PyPy. For the last few years i have been trying to find the most efficient way to pass UTF8 strings between PyPy and C code using cffi. Right now when PyPy receives a utf8 string (from a C function) it has to do 2 copies: