guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inlining calls to primitives


From: Neil Jerram
Subject: Re: Inlining calls to primitives
Date: Mon, 04 Sep 2006 23:02:23 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hi,
>
> I conducted an experiment with the evaluator consisting in implementing
> "inlining" of calls to a few primitive procedures and I'd like to get
> feedback about it.

Interesting piece of work.

It seems to me, though, that there are 3 things going on here.

1. Memoization of global variable references that yield one of a
   particular subset of common procedures.  (I call this part
   memoization because it seems similar to the memoization that we
   already do for syntax like let, begin, and, etc.)

2. Inlining of the code for these procedures within CEVAL.

3. Changing IM_SYMs to be dynamic instead of fixed constants, plus the
   macrology and GCC jump table stuff.

Do you know what the relative contributions of these 3 changes are?

It would be nice if most of the benefit was coming from (1), because
we could provide this in a very general way for all global variables,
and without needing the code duplication that (2) brings.  But I'd be
surprised if (1) on its own could give us 20% performance improvement,
because we already memoize from <global variable name> to <variable
object>, so the delta is just that from <variable object> to <variable
value>, which is a pointer dereference.  I'd also be surprised,
however, if (2) was a significant contribution, because I didn't think
a function call was a significant overhead these days.

Regards,
     Neil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]