From: Matthew Mondor <mm_lists@pu...> - 2009-07-08 12:50:02
Some time ago I wanted to test the performance differences between
various models with which object state can be maintained, to get a
better feel of the language and its performance.
So I implemented a simple generic iterator system using closures and
multiple values, closures and a structure, closures and a CLOS class,
and finally a CLOS-based implementation maintaining state in classes
with much more generic function automatic dispatching.
Previously I only did the measurements with SBCL, but I now also added
ECL interpreted and compiled results, which might be of interest to
this list, so I wanted to share it. Unlike a shootout contest, this is
closer to real world code. Since the same code is implemented in
various ways, it helps to know when preformance may degrade using
critical parts of the language.
For instance, I always suspected that CLOS had a performance impact
(even on SBCL), yet I never realized its extent before testing actual
code. This isn't "proper profiling" per say (I had no intention to
tweak the internals of CL implementations, I wanted to know which
practices generated faster code in general).
The four implementations and measurements are at