[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings
From: |
Andy Wingo |
Subject: |
Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings |
Date: |
Tue, 05 May 2020 09:23:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi :)
On Wed 29 Apr 2020 22:22, Ludovic Courtès <address@hidden> 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 optimization. Since it's internal, no problem from me. My concern
is only about calcifying aspects of our C / GC interface in API.
> On IRC, Andy mentioned concerns that the SCM could disappear and thus,
> our the internal pointer returned by ‘scm_locale_string_data’ wouldn’t
> be enough to prevent the stringbuf from being GC’d.
I would suggest doing the whole optimization and being sure to do
scm_remember_upto_here_1 on the SCM value at use sites.
Andy
- Re: [PATCH] Avoid malloc/free/dynwind for POSIX subrs that take strings,
Andy Wingo <=