Hello,
maybe the code above / inside getstring already knows that string length,
and you could exploit that fact to avoid the strlen calculation...
On Fri, Sep 26, 2014 at 6:51 PM, Armin Rigo wrote:
> Hi,
>
> On 25 September 2014 16:57, Eleytherios Stamatogiannakis
> wrote:
> > Wouldn't an "st
Hi,
On 25 September 2014 16:57, Eleytherios Stamatogiannakis
wrote:
> Wouldn't an "strbuffer" that does this scan (opportunistically) be faster
> for cases like above?
No, it can't be faster than my last solution. There is no way we're
going to add custom logic for a special case into the gener
On 25/09/14 15:10, Armin Rigo wrote:
Hi,
On 25 September 2014 09:06, Elefterios Stamatogiannakis
wrote:
Unfortunately, the C library that i use (libsqlite3) does not provide a
function like that :( . It has a function that returns the size of the
string, but in my tests the overhead of doing a
Hi,
On 25 September 2014 09:06, Elefterios Stamatogiannakis
wrote:
> Unfortunately, the C library that i use (libsqlite3) does not provide a
> function like that :( . It has a function that returns the size of the
> string, but in my tests the overhead of doing another CFFI call (to find the
> si
On 24/09/14 20:13, Armin Rigo wrote:
Hi,
On 23 September 2014 14:54, Eleytherios Stamatogiannakis
wrote:
p = clib.getString(...)# a "char *"
length = clib.strlen(p) # the standard strlen() function from C
b = unicode(ffi.buffer(p, length), 'utf-8')
I've tried that, and the overhe
Hi,
On 23 September 2014 14:54, Eleytherios Stamatogiannakis
wrote:
>> p = clib.getString(...)# a "char *"
>> length = clib.strlen(p) # the standard strlen() function from C
>> b = unicode(ffi.buffer(p, length), 'utf-8')
>
> I've tried that, and the overhead of the second call is more
On Tue, Sep 23, 2014 at 8:54 AM, Eleytherios Stamatogiannakis <
est...@gmail.com> wrote:
> On 23/09/14 09:52, Armin Rigo wrote:
>
>> Hi Lefteris,
>>
>> On 22 September 2014 19:37, Eleytherios Stamatogiannakis
>> wrote:
>>
>>> b = unicode( ffi.buffer( clib.getString(...) ) ,'utf-8')
>>>
>>> becaus
On 23/09/14 09:52, Armin Rigo wrote:
Hi Lefteris,
On 22 September 2014 19:37, Eleytherios Stamatogiannakis
wrote:
b = unicode( ffi.buffer( clib.getString(...) ) ,'utf-8')
because it'll only return the first character of getString, due to being
declared as a 'char*'.
The issue is only that f
Hi Lefteris,
On 22 September 2014 19:37, Eleytherios Stamatogiannakis
wrote:
> b = unicode( ffi.buffer( clib.getString(...) ) ,'utf-8')
>
> because it'll only return the first character of getString, due to being
> declared as a 'char*'.
The issue is only that ffi.buffer() tries to guess how lon