[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Putting an end to "compiled closures"
From: |
Ludovic Courtès |
Subject: |
Re: Putting an end to "compiled closures" |
Date: |
Sun, 08 Mar 2009 17:18:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) |
Hello!
I did some more fiddling with gsubrs:
http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=8321ed20f69b4c56cb680563160cd30ecac8f509
The change adds a vararg function to invoke gsubrs when the number of
arguments is known, thereby eliminating consing.
The benchmark is as follows:
- before
("subr.bm: subr invocation: simple subr" 700000 total 0.98)
("subr.bm: subr invocation: generic subr" 700000 total 1.39)
("subr.bm: subr invocation: generic subr with rest arg" 700000 total 1.32)
("subr.bm: subr invocation: generic subr with rest arg and 3+ parameters"
700000 total 1.63)
- after
("subr.bm: subr invocation: simple subr" 700000 total 1.0)
("subr.bm: subr invocation: generic subr" 700000 total 1.1)
("subr.bm: subr invocation: generic subr with rest arg" 700000 total 1.19)
("subr.bm: subr invocation: generic subr with rest arg and 3+ parameters"
700000 total 1.65)
That's again a 20% improvement for gsubrs with no rest argument
(`hashq-ref', `substring', `open', `string-upcase', `gettext', etc.) and
a 10% for procedures with a rest argument called with less than 3
arguments (e.g., `(cons* 1 2)', `(run-hook h 1)', `(throw 'foo 'bar)',
`(make-regexp "foo")').
Thanks,
Ludo'.