[m-users.] Enable LCMC tail recursion optimization by default?

Julien Fischer jfischer at opturion.com
Wed Apr 20 10:15:11 AEST 2016


On Wed, 20 Apr 2016, Zoltan Somogyi wrote:

> On Tue, 19 Apr 2016 23:06:27 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> I am now doing a more extensive test, to see what the performance effect is
>> of compiling the compiler itself with --optimize-constructor-last-call.
>
> Those tests are now done. The results:
>
> compiler in hlc.gc,           with no lcmc   15.29
> compiler in hlc.gc,           with lcmc        15.34
> compiler in asm_fast.gc, with no lcmc    15.85
> compiler in asm_fast.gc, with lcmc         16.18
>
> So when the compiler itself compiled in grade hlc.gc, enabling
> last constructor modulo call leads to a 0.3% slowdown. That is
> barely measurable, and would be, I think, a reasonable price
> to pay to eliminate some (though not all) causes of stack exhaustion.
>
> When the compiler is compiled in grade asm_fast.gc, the cost
> is higher: about a 2.1% slowdown. That is harder to justify
> imposing on everyone.

Pretty much all of Opturion's software is compiled with
--optimize-constructor-last-call enabled.  I suspect that may be the
case for many other users as well: having programs not crash is a lot
more important than them being 2.1% slower.  (Admittedly, the slowdown
isn't really an issue for us since most of our production stuff uses the
high-level C backend anyway.)

Julien.


More information about the users mailing list