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


    Date: Thu, 22 Feb 90 22:38 EST
    From: jka@vega.crd.ge.com (Jim Aragones)

    Would anyone care to try and tell me why the first function takes over 5
    minutes and about 800,000 words to compile, yet the second one, which
    merely defines local functions to do the work, compiles instantly?   It
    is very annoying either having to wait an hour to compile a file OR
    having to fill your code with bogus functions to get it to compile in a
    reasonable amount of time.

The Symbolics code walker has some algorithms that are quadratic, or
perhaps even O(n^3), in the number of nested macros.  By moving some of
the macros into separate functions you reduce the nesting.

One thing that sometimes helps is to make sure that the first form in
the body of a macro invocation or special form isn't a macro invocation.
Forms that allow declarations at the beginning of the body must expand
a macros there to see whether they expand into declarations; so, write

	(let (...)
	  (declare ...) ;; declarations, if necessary
	  nil ;; no more declarations
	  (dw:with-output-as-presentation ...))

This doesn't fix the quadratic behavior, but it does reduce the