[Top][All Lists]

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

[Help-smalltalk] Re: GNU ST Speed

From: Paolo Bonzini
Subject: [Help-smalltalk] Re: GNU ST Speed
Date: Tue, 7 Jan 2003 10:34:35 +0100
User-agent: Mutt/1.4i

> I tried the version 2.0h and I saw a lot of improvements!
> Amazing work!


> I was trying to compare the speed of St/X and GNU St.
> I tried just a simple example of a factorial:
> Integer>>factorial
>  |p i|
>  p := 2.
>  i := 3.
>  [i <= self] whileTrue: [
>   p := p * i.
>   i := i + 1.
>  ].
>  ^p

Why don't you use the bundled factorial method?  It is optimized to the
extreme... also check that you are using GMP.  ST/X's LargeIntegers are
coded in C, without GMP GNU Smalltalk's are coded in Smalltalk.

> Then I did-it: 1000 timesRepeat: [1000 factorial], on GNU St it took many
> minutes to complete and it was scavenging all the time.

A scavenging takes a few milliseconds.  Even using -g might improve the
performance by avoiding printing the messages.  It might also be worthwhile
to increase the size of new-space (see methods in ObjectMemory) -- in
general, not only for this example -- for example having 1 MB of new-space
and 200 Kb for each survivor space (total 1,5 MB; currently I have 300 Kb
and 40 Kb).  More info on the new GC/memory manager is found in the info


reply via email to

[Prev in Thread] Current Thread [Next in Thread]