[Ecls-list] ECL and profiling

Matthew Mondor mm_lists at pulsar-zone.net
Sat Sep 15 17:36:22 UTC 2012


At http://ecls.sourceforge.net/ecl/The-profiler.html#The-profiler are
listed a few functions, which despite building ECL with --with-profile
appear to be existing yet unbound symbols.

I also see in contrib/ a profile tool ported from SBCL, but
unfortunately the SBCL documentation I can find seems to address
another profiler (sb-prof).  If I look at the source, the profiler
appears to only be able to profile specified functions, when I'd like
to have more complete profiling.

I guess that since ECL compiles to C it'd also be possible to use gprof
and other C profiling tools, though.  But is there another recommended

I have resumed a bit work on my httpd (now named Crow), and since
yesterday it also hosts my personal site.  The server's hardware is
modest compared to my development system (although Crow runs fine and is
not slower than the previous js-written HTTPd which hosted my site for
years), I'm at a stage where profiling would be nice to have, instead
of blindly optimizing every function.

Optimizing is also a way to get better aquainted with ECL.  I noticed
yesterday how rewriting URL-ENCODE differently increased its speed
50-fold (it previously used REDUCE (with custom LAMBDA), CONCATENATE,
MAP (with custom LAMBDA), FORMAT, as well as a CHARACTER-VALID-P
function which was passed a dynamic variable as its table, all of which
resulting in a tremendous amount of function calls for simple string
processing).  It was elegant to read and fast to write, which was fine
for early interactive development, but really had to be rewritten for
production use (it now expands to efficient mostly inline C).

I also discovered that CHAR<= couldn't be inlined as <= can, such that
a macro expanding to CHAR-CODE and <= resulted in a significant speed
improvement to test if a character is within an expected range (see
It's possible that the compiler only needs some small modification to
allow inlining CHAR* functions, but I've not looked at that yet.


More information about the ecl-devel mailing list