[armedbear-devel] Inline primitives as static method calls
Alessio Stalla
alessiostalla at gmail.com
Mon Nov 9 22:40:58 UTC 2009
Attached is a patch + a Java class that tentatively implement
logicmoo's idea of "inlining" primitives as calls to static methods
(just for test on a single primitive, COPY-TREE).
The Java class, InlinedPrimitive, extends Primitive and implements its
execute() methods with static methods with a given name found in a
given class.
When interpreted or passed as a higher-order function an
InlinedPrimitive calls the static method through reflection, resulting
in slower performance than now.
But, when compiled it is translated as a direct call to the static
method, without passing through the symbol, which is faster than now
(I haven't measured how much faster).
Consider this patch as a rough draft - it must be polished if we ever
decide to include it. In particular "inlining" is always performed,
while we should probably avoid it with some debug/speed settings.
Bye,
Alessio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InlinedPrimitives.patch
Type: text/x-patch
Size: 6140 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20091109/75ef1580/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InlinedPrimitive.java
Type: text/x-java
Size: 8039 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20091109/75ef1580/attachment.java>
More information about the armedbear-devel
mailing list