openmcl bigfloat benchmark (was: Maxima + openmcl windows installer)



The computation of %pi (float.lisp/fppi1) was not a good example for
bigfloat-computations. It mainly consists of integer multiplications.
And here Clozure behaves different from GCL and clisp.

In detail:
1. computing the sqrt (float.lisp/fproot) seems to be a typical
bigfloat-computation. Nearly the same results:

on XP:
using Lisp Clozure Common Lisp Version 1.4-r13122  (WindowsX8632)
(%i1) thru 1000 do sqrt(sqrt(2b0^10000-1))$
(%i2) time(%o1);
(%o2)                               [0.711]
on XP:
Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
(%i1) thru 1000 do sqrt(sqrt(2b0^10000-1))$
(%i2) time(%o1);
(%o2)                                [0.6]
on Ubuntu:
Using Lisp CLISP 2.44.1 (2008-02-23)
(%i1) thru 1000 do sqrt(sqrt(2b0^10000-1))$
(%i2) time(%o1);
(%o2)                             [0.632039]

2. biginteger-multiplication seems to be of type O(n^2) in Clozure and
of O(n^1.5) in GCL and clisp:

using Lisp Clozure Common Lisp Version 1.4-r13122  (WindowsX8632)
(%i1) (n:2^10000-1, thru 1000 do n*n)$
(%i2) time(%o1);
(%o2)                               [0.44]
(%i3) (n:2^20000-1, thru 1000 do n*n)$
(%i4) time(%o3);
(%o4)                               [1.723]
(%i5) (n:2^40000-1, thru 1000 do n*n)$
(%i6) time(%o5);
(%o6)                               [8.192]
(%i7) (n:2^80000-1, thru 1000 do n*n)$
(%i8) time(%o7);
(%o8)                              [26.218]
(%i9) (n:2^160000-1, thru 1000 do n*n)$
(%i10) time(%o9);
(%o10)                             [99.473]

Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
(%i1) (n:2^10000-1, thru 1000 do n*n)$
(%i2) time(%o1);
(%o2)                               [0.11]
(%i3) (n:2^20000-1, thru 1000 do n*n)$
(%i4) time(%o3);
(%o4)                               [0.28]
(%i5) (n:2^40000-1, thru 1000 do n*n)$
(%i6) time(%o5);
(%o6)                                [0.9]
(%i7) (n:2^80000-1, thru 1000 do n*n)$
(%i8) time(%o7);
(%o8)                               [2.07]
(%i9) (n:2^160000-1, thru 1000 do n*n)$
(%i10) time(%o9);
(%o10)                              [5.67]

Using Lisp CLISP 2.44.1 (2008-02-23)
(%i1) (n:2^10000-1, thru 1000 do n*n)$
(%i2) time(%o1);
(%o2)                             [0.260016]
(%i3) (n:2^20000-1, thru 1000 do n*n)$
(%i4) time(%o3);
(%o4)                             [0.720044]
(%i5) (n:2^40000-1, thru 1000 do n*n)$
(%i6) time(%o5);
(%o6)                             [2.144133]
(%i7) (n:2^80000-1, thru 1000 do n*n)$
(%i8) time(%o7);
(%o8)                             [6.312395]
(%i9) (n:2^160000-1, thru 1000 do n*n)$
(%i10) time(%o9);
(%o10)                            [18.661167]

Volker

Am Montag, den 14.12.2009, 19:54 -0600 schrieb Barton Willis:
> I thought the slowness in bfloats might be due to overall slowness
> with integer arithmetic. But look at my benchmark 4:
> 
> Benchmark 4: hsum(5000), where
> 
> (defun $hsum (n)
>   (let ((s 0))
>     (while (> n 0)
>       (setq s (+ s (/ 1 n)))
>       (decf n))
>     (list '(rat simp) (numerator s) (denominator s))))
> 
>                     CCL 1.4               GCL 2.6.8
> Benchmark 1       0.6720 sec                 0.080 sec
> Benchmark 2      71.9380                     4.73
> Benchmark 4       0.780                     29.17
> 
> Barton
> 
> -----maxima-bounces at math.utexas.edu wrote: -----
> 
> >To: Volker van Nek <volkervannek at googlemail.com>
> >From: Jaime Villate <villate at fe.up.pt>
> >Sent by: maxima-bounces at math.utexas.edu
> >Date: 12/14/2009 04:06PM
> >cc: Maxima at math.utexas.edu, Andrej Vodopivec <andrej.vodopivec at gmail.com>
> >Subject: Re: [Maxima] openmcl bigfloat benchmark (was: Maxima + openmcl
> >windows installer)
> >
> >On Mon, 2009-12-14 at 21:52 +0100, Volker van Nek wrote:
> >> I have noticed that bigfloat computations are quite slow with Clozure.
> >
> >I can confirm that with Maxima 5.10.1 + Lisp Clozure Common Lisp Version
> >1.3-RC1-r11719M (in Ubuntu amd64) even though CCL is very fast in
> >floating point calculations.
> >
> >I used the following 3 benchmark commands:
> >
> >1- bfloat(%pi), fpprec:10000$
> >2- bfloat(%pi), fpprec:100000$
> >3- rk([x*(y^2+2*x*y-x-15*y/4+1), y*(-2*x^2-x*y+y+15*x/4-1)],[x,
> >y],[0.26,0.26],[t,0,500,0.1])$
> >(numerical solution of a non-linear differential equation).
> >
> >Results (times in seconds):
> >              CLISP 2.44.1      SBCL 1.0.18   CCL 1.3-RC1-r11719M
> >Benchmark 1     0.0700            0.0500          0.4200
> >Benchmark 2     4.5700            3.3200         30.9300
> >Benchmark 3     7.6400            1.7600          1.5200
> >
> >CCL is fastest one in floating-point calculations, but about 10 times
> >slower than SBCL in the bfloat calculation.
> >
> >Regards,
> >Jaime
> >
> >
> >_______________________________________________
> >Maxima mailing list
> >Maxima at math.utexas.edu
> >http://www.math.utexas.edu/mailman/listinfo/maxima
>