Hi all,

I'd like to make the tests for numbers compile so that it tests not just
the library itself but also the newly added types database (I know, the
tests need more work to be able to actually test this properly, but bear
with me).

However, compilation time goes through the roof!  At first, I thought it
was expansion time in this horrible numbers syntax test which was also
put in Chicken itself, but it turns out not to be the case.

Just compiling the tests that I took from Gauche takes over a minute:

$ time csc numbers-test-gauche.scm
csc numbers-test-gauche.scm  70.82s user 1.23s system 98% cpu 1:13.24 total

(master and 4.7.0 take long)  The r4rs tests also take rather long;
about 32 seconds.  But it gets worse!
When you combine the whole bunch by running "csc run.scm" (which contains
INCLUDE statements for all the separate test scripts), it takes
7.5 *minutes* to compile (and lots of memory; 256MB - but I consider
that less important at the moment), which is of course not acceptable
just to run a bunch of tests!

It looks like we have a bad case of exponential complexity somewhere
in the compiler, since I had expected the total compilation time to be
in the ballpark of the sum of the individual compilation times.

I was wondering if someone could provide some insight in how to figure
out what causes it to take so long to compile.  I've already pinpointed
that the behaviour is somewhere in the analyzer / code emitter since
"csc -P numbers-test-gauche.scm" takes about 1.46 seconds but
"csc -A numbers-test-gauche.scm" takes about 10 seconds and
"csc -t numbers-test-gauche.scm" takes about 64 seconds.

It turns out that compiling with -O0 doesn't change this much and it
actually gets worse, so it's probably not some part of the optimizer,
which I initially expected.

The complexity figures for the whole bulk of run.scm are similar;
about a quarter of the compilation time is spent in the analyzing phase.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to