[PEAK] Regular functions vs generic functions

Phillip J. Eby pje at telecommunity.com
Fri Feb 15 11:32:30 EST 2008

At 10:36 AM 2/15/2008 -0500, rdmurray at bitdance.com wrote:
>Interestingly, in this application I'm working on (well, I've stopped
>working on it again for the moment as there are other things on my plate
>that have bumped it), there is a noticeable startup delay when the first
>generic function with a complex dispatch tree is called.  When I say
>noticeable, I mean on the order of five seconds.

Can you send source for this?  You can get rid of the rule bodies, 
since those won't affect the tree build time.  That way, I can 
profile the build process and see what's happening.  It shouldn't 
take five seconds to build a dispatch tree, unless I've inadvertently 
left in some algorithm that's supra-linear in time and it's blowing up.

The other possibility, of course, is that there's something really 
pathological about the ruleset itself, like a ruleset with lots of 
ambiguity, or where class-instance tests are at the leaves of the 
tree instead of the roots.  That could potentially cause an 
exponential blowup in the size of the tree as well as time needed to 
build it.  (One important difference in PEAK-Rules is that, for 
simplicity's sake, most dispatch node types are expanded eagerly 
instead of lazily as in RuleDispatch.  So, PEAK-Rules may expand 
portions of the tree that might never actually be used.)

More information about the PEAK mailing list