Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings

2020-05-22 Thread Ludovic Courtès
Hi! Andy Wingo skribis: > On Sun 17 May 2020 23:46, Ludovic Courtès writes: > >> The libunistring functions can take a pre-allocated buffer, but they >> always malloc a fresh one if needed. So the best we could do is have a >> ‘scm_to_stringn’ variant that takes a buffer, but it’s not guarante

Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings

2020-05-17 Thread Andy Wingo
On Sun 17 May 2020 23:46, Ludovic Courtès writes: > The libunistring functions can take a pre-allocated buffer, but they > always malloc a fresh one if needed. So the best we could do is have a > ‘scm_to_stringn’ variant that takes a buffer, but it’s not guaranteed > that it’ll actually be used.

Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings

2020-05-17 Thread Ludovic Courtès
Hi, Andy Wingo skribis: > On Wed 29 Apr 2020 22:22, Ludovic Courtès writes: > >> As discussed on IRC, the patch below arranges so that subrs that take >> strings and pass them to syscall wrappers can avoid the >> malloc/free/dynwind overhead. This gives a 10% speedup on a tight loop >> that ca

Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings

2020-05-05 Thread Andy Wingo
Hi :) On Wed 29 Apr 2020 22:22, Ludovic Courtès writes: > As discussed on IRC, the patch below arranges so that subrs that take > strings and pass them to syscall wrappers can avoid the > malloc/free/dynwind overhead. This gives a 10% speedup on a tight loop > that calls these subrs: Neat opt

[PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings

2020-04-29 Thread Ludovic Courtès
Hello Guilers! As discussed on IRC, the patch below arranges so that subrs that take strings and pass them to syscall wrappers can avoid the malloc/free/dynwind overhead. This gives a 10% speedup on a tight loop that calls these subrs: --8<---cut here---start-