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'.



Reply via email to