JØrgen Tischer wrote:
> On Saturday 20 October 2001 03:33, you wrote:
>
> > About the "hard way" of compiling gcl and maxima :
> > it would be a nice idea to include Vadim Zhynikov's ideas
> > in a recent post and a clarification on how to handle
> > the memory.
>
> I compiled maxima-gcl with a higher MAXPAGE and used Vadims init.lsp, i.e.
>
> (progn
> (si::allocate 'cons 20000 t)
> (si::allocate 'fixnum 4000 t)
> (si::allocate-relocatable-pages 10000 t)
> (si::allocate 'cfun 5000 t)
> (si::set-gmp-allocate-relocatable t)
> (setq si::*notify-gbc* t))
>
> Then I tried to find out how fast this new version would be. I used
>
> factor(expand((x+y)^n)+1)$
>
> for n=30, 60, 100, and 105. With 100 maxima (gcl) run into serious problems:
>
> (C7) factor(expand((x+y)^100)+1)$
>
> [GC for 7500 RELOCATABLE-BLOCKS pages..(T=12).GC finished]
> [GC for 5000 CFUN pages..(T=15).GC finished]
> [GC for 7500 RELOCATABLE-BLOCKS pages..(T=15).GC finished]
> [GC for 5000 CFUN pages..(T=15).GC finished]
> [GC for 5000 CFUN pages..(T=15).GC finished]
> [GC for 7500 RELOCATABLE-BLOCKS pages..(T=13).GC finished]
> [GC for 5000 CFUN pages..(T=14).GC finished]
> [GC for 5000 CFUN pages..(T=15).GC finished]
> [GC for 7500 RELOCATABLE-BLOCKS pages..(T=12).GC finished]
> etc
>
> I had to interrupt it. The reason was
> (si::set-gmp-allocate-relocatable t)
>
> without this line, the times were:
> n=30: 0.7 sec; n=60: 4.04 sec; n=100: 4.07 sec; n=105: 317.27 sec
> That was with 121 M Ram in use.
>
> Now the numbers for clisp:
> n=30: 0.58 sec (4.5 M RAM); n=60: 5.45 sec (4.8 M); n=100: 11.79 sec (4.6
> M); n=105: 60.89 sec (5.2 M);
>
> And cmucl:
> n=30: 0.15 sec (11 M RAM); n=60: 2.19 sec (12 M); n=100: 5.05 sec (15 M);
> n=105: 28.51 sec (17 M);
>
I decided to repeat your test and I've got similar results.
Maxima 5.6 (latest CVS)+GCL 2.4.0 with (si::set-gmp-allocate-relocatable t)
n=30: 0.1
n=60: 1.69
n=100: killed after very long time
The same ;;(si::set-gmp-allocate-relocatable t) commented out
n=30: 1.39
n=60: 40.18 (lots of CONTIGUOUS-BLOCKS garbage collections)
I also noticed other very strange errors with combination Maxima 5.6 (latest
CVS)+GCL 2.4.0.
By default (no any init.lsp) it fails on standard maxima tests. It either goes
into infinite (or very
long loop) on some TRIGSIMP test or stops with with "Quotient by zero" message
on other PARTFRAC test. But is use init.lsp as above then all tests are OK!
It seems that anyway something is seriously wrong GCL 2.4.0 and I suspect that
gmp is the troublemaker. So I switched back to GCL 2.3.8-beta3.
And repeated tests once again. First of all now I do not have any problems
with standard maxima tests. They all pass whether with init.lsp or not.
And now results of factor(expand((x+y)^n+1)$ tests.
Maxima 5.6 (latest CVS)+GCL 2.3.8-beta8 with init.lsp
as above but without (si::set-gmp-allocate-relocatable t)
and with cfun reduced to 200 instead of 5000
n=30: 0.15
n=60: 4.84
n=100: 7.03
n=105: 36.10
RAM initially was 140Mb but finally it increased to 188Mb.
Much better. The behavior is at least predictable.
I'd not recommend to use GCL 2.4.0 with Maxima.
There is also another method to improve GCL memory allocation.
Function allocate-growth tells GCL how to allocate
new chunks of RAM if memory of some type is exhausted.
The size of the chink can be tuned as well.
But frankly I'd better move Maxima to other lisp.
My experience with GCL is not so promising so far.
I think this is important with respect to Maxima future.
Many times I've heard that Maxima suffers from bad performance
and now I see that significant part of the problem is not in
the Maxima itself but rather in the background lisp system.
Quite sad :-(
Best wishes,
Vadim
--
[ Vadim V. Zhytnikov <vvzhy@mail.ru> <vvzhy@td.lpi.ac.ru> ]