[Openmcl-devel] Sudden increment in executable image size.
kaz at kylheku.com
Tue Nov 11 19:27:58 PST 2014
[This is a repost: due to a DMARC configuration issue,
the original may not have reached the mailing list
recipients. Sincere apologies if you are seeing this twice!]
On 17.11.2010 22:14, Kaz Kylheku wrote:
> On Wed, 17 Nov 2010 22:01:21 -0800, Kaz Kylheku <kaz at kylheku.com>
>> It turns out that the heap size suddenly jumps after the very last
>> file is loaded.
> I have isolated it to the use of a particular macro (mine, not CCL's)
> in that file.
I have revisited this four-year-old issue. I fetched a new CCL, on a new
machine, built the program, and the problem still reproduced.
What's going on is that a particular macro is used in several places
(not very many) and that macro generates some local functions which call
the CL-PPCRE API function regex-replace-all. (Not at macro-expansion
time: the calls to the function are just macro-generated code!)
The regular expressions involved are tiny and trivial; nothing that
would explode a DFA state space.
Yet, the way this function is compiled somehow results in tremendous
bloat. Each instance of the function call adds bloat. The macro
generates two calls to the function; if I change the macro so it only
generates one call to that function, the bloat delta cuts in half.
So I went into the "cl-ppcre/api.lisp" source file and put, above the
(declaim (notinline regex-replace-all))
Bingo. This makes the problem go away. Instead of a nearly 70 megabyte
executable, I get a 25 megabyte executable, which is about expected
More information about the Openmcl-devel