From: Eric Lavigne
Subject: arithmetic speed
Date: 
Message-ID: <1114528749.677540.22480@f14g2000cwb.googlegroups.com>
I am posting two short blocks from my code. The first (with-timing
"x"...) takes practically time (0 ticks, I assume there's some
rounding...) while the second (with-timing "make-node"...) takes over
200 ticks, both using Peter Seibel's profiling utility from the last
chapter of Practical Common Lisp. The second looks no more than twice
as complicated to me, so more than 200 times longer doesn't make sense.
Any ideas? Simple as it looks, the second block is a huge bottleneck in
my code, so I need a way to speed it up. The complete program
(Diffusion Code 3) is on my website plaza.ufl.edu/lavigne/
All of these snippets came from the phi-calc function.

    ; these declarations taken from earlier in function
    ; just to show types of relevant variables
    (declare (single-float source dx))
    (declare (single-float
              x-contrib y-contrib z-contrib D sigma-a
              x1 x2 y1 y2 z1 z2))
    (declare (fixnum n))

    (with-timing "x"
    (if (< (min x1 x2)
           (* (max x1 x2)
              (1- (/ 4 (+ 2 (/ dx D))))))
        (progn
          (setq x-contrib (* 2 (max x1 x2)))
          (setf n  (1+ n)))
        (setq x-contrib  (+ x1 x2))))

    (with-timing "make-node"
     (/ (+ x-contrib y-contrib z-contrib
           (* dx dx source (/ D)))
        (+ (* dx dx (/ D) sigma-a)
           6 (* (sqrt n) dx (/ D)))))))

From: JP Massar
Subject: Re: arithmetic speed
Date: 
Message-ID: <esps61964477fphh272l6l1tnnqbtrp4tc@4ax.com>
On 26 Apr 2005 08:19:09 -0700, "Eric Lavigne" <············@gmail.com>
wrote:

>I am posting two short blocks from my code. The first (with-timing
>"x"...) takes practically time (0 ticks, I assume there's some
>rounding...) while the second (with-timing "make-node"...) takes over
>200 ticks, both using Peter Seibel's profiling utility from the last
>chapter of Practical Common Lisp. The second looks no more than twice
>as complicated to me, so more than 200 times longer doesn't make sense.
>Any ideas?

Calling SQRT could be the bottleneck.  If the range of N is small
you could replace the call with an array lookup table.

Also, you compute the equivalent of (* dx (/ D)) three times,
which may or may be be optimized by your compiler.  Compute it
once with a LET and see if the timing improves.

> Simple as it looks, the second block is a huge bottleneck in
>my code, so I need a way to speed it up. The complete program
>(Diffusion Code 3) is on my website plaza.ufl.edu/lavigne/
>All of these snippets came from the phi-calc function.
>
>    ; these declarations taken from earlier in function
>    ; just to show types of relevant variables
>    (declare (single-float source dx))
>    (declare (single-float
>              x-contrib y-contrib z-contrib D sigma-a
>              x1 x2 y1 y2 z1 z2))
>    (declare (fixnum n))
>
>    (with-timing "x"
>    (if (< (min x1 x2)
>           (* (max x1 x2)
>              (1- (/ 4 (+ 2 (/ dx D))))))
>        (progn
>          (setq x-contrib (* 2 (max x1 x2)))
>          (setf n  (1+ n)))
>        (setq x-contrib  (+ x1 x2))))
>
>    (with-timing "make-node"
>     (/ (+ x-contrib y-contrib z-contrib
>           (* dx dx source (/ D)))
>        (+ (* dx dx (/ D) sigma-a)
>           6 (* (sqrt n) dx (/ D)))))))
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114534693.547984.132290@f14g2000cwb.googlegroups.com>
>Calling SQRT could be the bottleneck.  If the range of N is small
>you could replace the call with an array lookup table.
That was one of my guesses too. Replacing it with this didn't help:
 (cond ((eql n 0) 0.0) ((eql n 1) 1.0) ((eql n 2) 1.4) (t 1.7))

>Also, you compute the equivalent of (* dx (/ D)) three times,
>which may or may be be optimized by your compiler.  Compute it
>once with a LET and see if the timing improves.
A 200x difference coming from repeating an operation 3 times... I'll
give it a try but it doesn't sound hopeful.
From: JP Massar
Subject: Re: arithmetic speed
Date: 
Message-ID: <d9us61let9p2qjo5rb7mkslo7uicen02br@4ax.com>
On 26 Apr 2005 10:05:21 -0700, "Eric Lavigne" <············@gmail.com>
wrote:

>>Calling SQRT could be the bottleneck.  If the range of N is small
>>you could replace the call with an array lookup table.
>That was one of my guesses too. Replacing it with this didn't help:
> (cond ((eql n 0) 0.0) ((eql n 1) 1.0) ((eql n 2) 1.4) (t 1.7))
>
>>Also, you compute the equivalent of (* dx (/ D)) three times,
>>which may or may be be optimized by your compiler.  Compute it
>>once with a LET and see if the timing improves.
>A 200x difference coming from repeating an operation 3 times... I'll
>give it a try but it doesn't sound hopeful.

I never claimed this would solve you rentire 200x differential.  I
just said to see if it made any significant difference.

I tried the following code on Lispworks and Allegro, Windows XP
Pentium.   For a million iterations Lispworks took aproximate 4 times
as long for the 2nd 
as the first, while Allegro took approximately 20 times as long.

(defun foo (x1 x2 dx x-contrib d n)
  (declare (optimize (speed 3) (safety 0) (debug 0)))
  (declare (single-float x1 x2 dx x-contrib d))
  (declare (fixnum n))
 (if (< (min x1 x2)
           (* (max x1 x2)
              (1- (/ 4 (+ 2 (/ dx D))))))
        (progn
          (setq x-contrib (* 2 (max x1 x2)))
          (setf n  (1+ n)))
        (setq x-contrib (+ x1 x2)))
 x-contrib
 )

(defun bar (x-contrib y-contrib z-contrib dx sigma-a D source n)
  (declare (optimize (speed 3) (safety 0) (debug 0)))
  (declare (single-float x-contrib y-contrib z-contrib dx sigma-a D
d))
  (declare (fixnum n))
  (/ (+ x-contrib y-contrib z-contrib
        (* dx dx source (/ D)))
     (+ (* dx dx (/ D) sigma-a)
        6 (* (sqrt n) dx (/ D)))))


(defun time-them (n)
  (time (dotimes (j n) (foo 1.0 1.0 1.0 1.0 1.0 2)))
  (time (dotimes (j n) (bar 1.0 1.0 1.0 1.0 1.0 1.0 1.0 2))))
   
 
;;;; Allegro

AFRAME(36): (time-them 1000000)
; cpu time (non-gc) 93 msec user, 0 msec system
; cpu time (gc)     48 msec user, 0 msec system
; cpu time (total)  141 msec user, 0 msec system
; real time  141 msec
; space allocation:
;  2 cons cells, 16,000,000 other bytes, 0 static bytes
; cpu time (non-gc) 2,204 msec user, 0 msec system
; cpu time (gc)     624 msec user, 0 msec system
; cpu time (total)  2,828 msec user, 0 msec system
; real time  2,843 msec
; space allocation:
;  105 cons cells, 272,000,000 other bytes, 0 static bytes


;;;; Lispworks

AFRAME(36): (time-them 1000000)
; cpu time (non-gc) 93 msec user, 0 msec system
; cpu time (gc)     48 msec user, 0 msec system
; cpu time (total)  141 msec user, 0 msec system
; real time  141 msec
; space allocation:
;  2 cons cells, 16,000,000 other bytes, 0 static bytes
; cpu time (non-gc) 2,204 msec user, 0 msec system
; cpu time (gc)     624 msec user, 0 msec system
; cpu time (total)  2,828 msec user, 0 msec system
; real time  2,843 msec
; space allocation:
;  105 cons cells, 272,000,000 other bytes, 0 static bytes


Making the changes I suggested in BAR

(let ((array (make-array 1000)))
  (loop for j from 0 below 1000 do (setf (aref array j) (isqrt j)))
  (defun bar1 (x-contrib y-contrib z-contrib dx sigma-a D source n)
    (declare (optimize (speed 3) (safety 0) (debug 0)))
    (declare (single-float x-contrib y-contrib z-contrib dx sigma-a D
d))
    (declare (fixnum n))
    (let ((z (* dx (/ D))))
      (declare (single-float z))
      (/ (+ x-contrib y-contrib z-contrib
            (* dx z source))
         (+ (* dx z sigma-a)
            6 (* (aref array n) z))))))


Resulted in a factor of 2 improvement using Lispworks
and a factor of 3.5 improvement using Allegro.
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114539885.648062.179310@o13g2000cwo.googlegroups.com>
>(let ((temp  (* dx (/ D))))
>...
>Resulted in a factor of 2 improvement using Lispworks
>and a factor of 3.5 improvement using Allegro.

This fixed the entire 200x difference between the two sections of
code... and did absolutely nothing to the performance of gauss-seidel.
Looks like my profiling efforts were way off. Time to retrace my
steps...

Thanks for the help.
From: Gareth McCaughan
Subject: Re: arithmetic speed
Date: 
Message-ID: <874qdtxnfd.fsf@g.mccaughan.ntlworld.com>
Jp Massar wrote:

> I tried the following code on Lispworks and Allegro, Windows XP
> Pentium.   For a million iterations Lispworks took aproximate 4 times
> as long for the 2nd 
> as the first, while Allegro took approximately 20 times as long.
...
> ;;;; Allegro
> 
> AFRAME(36): (time-them 1000000)
...
> ;;;; Lispworks
> 
> AFRAME(36): (time-them 1000000)
[etc]

I think you have pasted timings for a single system twice. :-)

-- 
Gareth McCaughan
.sig under construc
From: JP Massar
Subject: Re: arithmetic speed
Date: 
Message-ID: <89bt61dsginpeqb42ko5vq5riigi1d1que@4ax.com>
On Tue, 26 Apr 2005 21:03:28 GMT, Gareth McCaughan
<················@pobox.com> wrote:

>Jp Massar wrote:
>
>> I tried the following code on Lispworks and Allegro, Windows XP
>> Pentium.   For a million iterations Lispworks took aproximate 4 times
>> as long for the 2nd 
>> as the first, while Allegro took approximately 20 times as long.
>...
>> ;;;; Allegro
>> 
>> AFRAME(36): (time-them 1000000)
>...
>> ;;;; Lispworks
>> 
>> AFRAME(36): (time-them 1000000)
>[etc]
>
>I think you have pasted timings for a single system twice. :-)

Doh!

;;; Lispworks

CL-USER 222 > (time-them 1000000)

Timing the evaluation of (DOTIMES (J N) (FOO 1.0 1.0 1.0 1.0 1.0 2))

user time    =      0.828
system time  =      0.000
Elapsed time =   0:00:01
Allocation   = 96000624 bytes standard / 1804 bytes conses
0 Page faults

Timing the evaluation of (DOTIMES (J N) (BAR 1.0 1.0 1.0 1.0 1.0 1.0
1.0 2))

user time    =      2.281
system time  =      0.000
Elapsed time =   0:00:02
Allocation   = 304016768 bytes standard / 4653 bytes conses
0 Page faults

Timing the evaluation of (DOTIMES (J N) (BAR1 1.0 1.0 1.0 1.0 1.0 1.0
1.0 2))

user time    =      1.359
system time  =      0.000
Elapsed time =   0:00:01
Allocation   = 192002456 bytes standard / 1210 bytes conses
0 Page faults
NIL
From: rif
Subject: Re: arithmetic speed
Date: 
Message-ID: <wj0pswhbjx9.fsf@five-percent-nation.mit.edu>
You didn't say what CL you were using, which is important.  I am
assuming you've compiled with optimizations turned on, which is also
important.  In general, looking at the compiler output for notes is
very helpful.  From eyeballing your code, my *guess* is that the
compiler can't rule out the possibility that n is negative, which
would make (sqrt n) complex, and set off a cascade in which most of
your results could be complex.  I think you could fix this by
replacing (sqrt n) with (the single-float (sqrt n)).

Side note: single-floats rather than double-floats are rarely what one
wants these days.  They do use half the memory, but they aren't
faster.  If I had plenty of memory, I would always use double-floats.

Cheers,

rif
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114534336.398734.99400@f14g2000cwb.googlegroups.com>
>You didn't say what CL you were using, which is important.
clisp, installed automatically as part of lisp in a box, windows xp

>I am assuming you've compiled with optimizations turned
>on, which is also important.
This line is at the beginning of my function:
  (declare (optimize (speed 3) (compilation-speed 0)
                     (debug 0) (safety 0)))

>In general, looking at the compiler output
>for notes is very helpful.
The compiler didn't give any output (except gauss-seidel, nil, nil).
The command I used was (compile 'gauss-seidel)

>my *guess* is that the compiler can't rule out
>the possibility that n is negative
I replaced (sqrt n) with
(cond ((eql n 0) 0.0) ((eql n 1) 1.0) ((eql n 2) 1.4) (t 1.7))
No significant change in speed. Messy as this looks, I would expect it
to be very fast, especially since n is usually 0.

>single-floats rather than double-floats are
>rarely what one wants these days
These number will range from 5 to 1e-7, easily covered by
single-floats. Besides, I'm not entirely sure whether memory will be an
issue. My program uses 50x50x50 arrays...
From: rif
Subject: Re: arithmetic speed
Date: 
Message-ID: <wj0ll75a2oy.fsf@five-percent-nation.mit.edu>
Most of my experience is with CMUCL or SBCL.  My understanding is that
CLISP doesn't do native floating-point operations, which is going to
make it slow in general --- if you care about doing fast
floating-point work, you should use a CL that compiles these down to
assembly.  However, this is not an explanation of why one code
fragment is relatively slower.  If it has nothing to do with sqrt, and
there's no compiler notes, the next thing I would do try disassemble
and look at what's being generated.

The fact that your numbers range from 5 to 1e-7 is not especially
relevant to the choice of single or double-precision floating point:
double-precision does have a larger range, but usually more important
is that it has much higher *precision* over any given range.  50x50x50
is still quite small --- a double-float 50x50x50 array takes about 1
MB of memory.  There is almost never a reason to use single-floats;
double-floats are not slower to compute with (on most modern
machines), and there's a whole class of cases where they'll save your
butt.

Cheers,

rif
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114536432.279691.203560@f14g2000cwb.googlegroups.com>
>My understanding is that CLISP doesn't do native floating-point
>operations, which is going to make it slow in general --- if you care
>about doing fast floating-point work, you should use a CL that
>compiles these down to assembly.

This is rather bad news for me. CMUCL and SBCL don't work on windows.
LispWorks trial has a heap size limit, works fine when zoomed in on the
bottleneck but dies if I try to run the whole program. Installing linux
is not something I can do in an afternoon, and several days of trying
to optimize have brought me dangerously close to my Thursday deadline.
Are there any other CLs that you would recommend?
From: GP lisper
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114545609.bf203214a18529b0a34296140b9b5012@teranews>
On 26 Apr 2005 10:27:12 -0700, <············@gmail.com> wrote:
>
> bottleneck but dies if I try to run the whole program. Installing linux
> is not something I can do in an afternoon, and several days of trying

You should google "Knoppix" sometime, getting a linux system running
can be done in an afternoon.  The KDE desktop is as simple as the
START button in windows.

Otherwise, there is a webpage about lisp benchmarks, where you should
find that CMUCL and SBCL are generally fastest.

Good luck on the deadline.

-- 
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.
From: Kenny Tilton
Subject: Re: arithmetic speed
Date: 
Message-ID: <odvbe.16643$mp6.2183270@twister.nyc.rr.com>
Eric Lavigne wrote:

>>My understanding is that CLISP doesn't do native floating-point
>>operations, which is going to make it slow in general --- if you care
>>about doing fast floating-point work, you should use a CL that
>>compiles these down to assembly.
> 
> 
> This is rather bad news for me. CMUCL and SBCL don't work on windows.
> LispWorks trial has a heap size limit, works fine when zoomed in on the
> bottleneck but dies if I try to run the whole program.

The AllegroCL trial version has different ways of limiting. Maybe that 
would work. And you sound like a student -- they have a $99 version.

> Installing linux
> is not something I can do in an afternoon...

You are right, it takes five minutes. <g>:

    http://www.knoppix.net/

Even /I/ got it working, /and/ installed to the hard drive. And I am 
just a simple application programmer who refuses to read doc.

, and several days of trying
> to optimize have brought me dangerously close to my Thursday deadline.
> Are there any other CLs that you would recommend?
> 

CormanCL? Just guessing.

kenny

-- 
Cells? Cello? Cells-Gtk?: http://www.common-lisp.net/project/cells/
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film

"Doctor, I wrestled with reality for forty years, and I am happy to 
state that I finally won out over it." -- Elwood P. Dowd
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114541818.781872.76860@z14g2000cwz.googlegroups.com>
>The AllegroCL trial version has different ways of limiting. Maybe that
>would work.

22 MB heap... Sounds like LispWorks, but I don't know what LispWorks'
limit is. Maybe 22 MB is enough for me. I actually don't even know what
a heap is, but my trial LispWorks often exits when it fills up.

>And you sound like a student -- they have a $99 version.

Grad student, and I think the student version can't be used for
research activities... or pretty much anything besides homework. I'm
doing ordinary homework now, but I try to avoid developing skills that
won't help me in other parts of my life. However stressful classes may
be, I try to treat them as they are meant to be - learning in
preparation for my other activities.

>You are right, it takes five minutes. <g>:
>    http://www.knoppix.net/
>Even /I/ got it working, /and/ installed to the hard drive. And I am
>just a simple application programmer who refuses to read doc.

I don't generally consider myself above simple application
programmers... more significantly those five minutes, if I fail, could
be followed by hours of trying to get my computer working again. I've
installed linux at least 10 times with a variety of distros, never took
less than an afternoon.

The other issue is that I'm not even sure anymore if it will solve my
problem. After finding out that my profiling effort gave bad results,
it's no longer clear whether floating point calculations have anything
to do with my bottleneck. I need to figure out what the real problem is
before I put too much effort into one solution.

I'm going to take a break, eat lunch, and come back at this problem
fresh. I appreciate everyone's help, but it's looking like I asked the
wrong question. Time to take a few steps back and figure out what's
going on.
From: GP lisper
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114546204.475b4b3703237fd78dfdc0e65af6a4ae@teranews>
On 26 Apr 2005 11:56:58 -0700, <············@gmail.com> wrote:

>>You are right, it takes five minutes. <g>:
>>    http://www.knoppix.net/
>
> programmers... more significantly those five minutes, if I fail, could
> be followed by hours of trying to get my computer working again. I've

A look into Knoppix would have showed you that it is totally CD based,
it only requires a simple reboot afterwards.  Knoppix is designed just
for your type of 'interested party' in linux.


-- 
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114554397.147505.34010@g14g2000cwa.googlegroups.com>
>A look into Knoppix would have showed you that it is totally CD based,
>it only requires a simple reboot afterwards.  Knoppix is designed just
>for your type of 'interested party' in linux.

I've started downloading the iso, which will take at least an hour. Is
Knoppix able to use the same filesystem I already have without
reformatting or repartitioning? This can't be done completely off the
cd because the knoppix package list doesn't have any lisp programs on
it, so I'll need a way to install at least that much.

ftp://ftp.cise.ufl.edu/pub/mirrors/packages.txt
From: Kenny Tilton
Subject: Re: arithmetic speed
Date: 
Message-ID: <426EC236.9030509@nyc.rr.com>
Eric Lavigne wrote:

>>A look into Knoppix would have showed you that it is totally CD based,
>>it only requires a simple reboot afterwards.  Knoppix is designed just
>>for your type of 'interested party' in linux.
> 
> 
> I've started downloading the iso, which will take at least an hour. Is
> Knoppix able to use the same filesystem I already have without
> reformatting or repartitioning? This can't be done completely off the
> cd because the knoppix package list doesn't have any lisp programs on
> it, so I'll need a way to install at least that much.
> 
> ftp://ftp.cise.ufl.edu/pub/mirrors/packages.txt
> 

Stop That Download!!

Damn, I was going to follow-up with a correction to my post. You want 
the Knoppix-based Lisp Resource Kit:

    http://common-lisp.net/project/lisp-res-kit/

kenny

-- 
Cells? Cello? Cells-Gtk?: http://www.common-lisp.net/project/cells/
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film

"Doctor, I wrestled with reality for forty years, and I am happy to 
state that I finally won out over it." -- Elwood P. Dowd
From: GP lisper
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114599609.ea36fe4c957b4066249af0a6e38a4bfb@teranews>
On 26 Apr 2005 15:26:37 -0700, <············@gmail.com> wrote:
>
> I've started downloading the iso, which will take at least an hour. Is
> Knoppix able to use the same filesystem I already have without
> reformatting or repartitioning? This can't be done completely off the
> cd because the knoppix package list doesn't have any lisp programs on
> it, so I'll need a way to install at least that much.

The answer is 'yes', but it may not be simple for you.  You create a
loopback filesystem within a single file (which can reside within your
windows filesystem).  Because

A) you cannot get this done and meet your deadline
B) you should switch to the knoppix-lisp mentioned by Kenny

I'll skip the details.

-- 
Everyman has three hearts;
one to show the world, one to show friends, and one only he knows.
From: Paolo Amoroso
Subject: Re: arithmetic speed
Date: 
Message-ID: <87d5shuysj.fsf@plato.moon.paoloamoroso.it>
"Eric Lavigne" <············@gmail.com> writes:

> research activities... or pretty much anything besides homework. I'm
> doing ordinary homework now, but I try to avoid developing skills that
> won't help me in other parts of my life. However stressful classes may
> be, I try to treat them as they are meant to be - learning in
> preparation for my other activities.

This well known quote by Eric Raymond seems relevant:

  LISP is worth learning for a different reason--the profound
  enlightenment experience you will have when you finally get it.
  That experience will make you a better programmer for the rest of
  your days, even if you never actually use LISP itself a lot.


Paolo
-- 
Why Lisp? http://lisp.tech.coop/RtL%20Highlight%20Film
Recommended Common Lisp libraries/tools (see also http://clrfi.alu.org):
- ASDF/ASDF-INSTALL: system building/installation
- CL-PPCRE: regular expressions
- UFFI: Foreign Function Interface
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114545382.329860.82770@g14g2000cwa.googlegroups.com>
>  LISP is worth learning for a different reason--the profound
>  enlightenment experience you will have when you finally get it.
>  That experience will make you a better programmer for the rest of
>  your days, even if you never actually use LISP itself a lot.

I read that article. It  convinced me to do some google searches and
decide if Lisp was worth learning. What really impressed me and made me
eager to dive in were Paul Graham's articles, especially Beating the
Averages.

First time I heard about Lisp was about 10 years ago, while doing a
library search for a junior high project on neural networks. The book
was called, I think, Lisp: the Language of Artificial Intelligence. I
skimmed the whole book, read a few chapters, decided that (1) this book
didn't tell me enough to actually be able to use Lisp for anything and
(2) Lisp seemed an awful lot like a database that someone was trying to
use as a programming language. I never followed up on it.

Anyhow, I'm not giving up on learning Lisp, just that I know I would
avoid using the Allegro trial in the long run because I would be
developing skills on an IDE that I could only use for homework. It
might still be useful for the next two stressful days, but I won't
spend $100 just for that.
From: Edi Weitz
Subject: Re: arithmetic speed
Date: 
Message-ID: <uis29tjjw.fsf@agharta.de>
On 26 Apr 2005 11:56:58 -0700, "Eric Lavigne" <············@gmail.com> wrote:

> I don't generally consider myself above simple application
> programmers... more significantly those five minutes, if I fail,
> could be followed by hours of trying to get my computer working
> again. I've installed linux at least 10 times with a variety of
> distros, never took less than an afternoon.

Something that works fine for me is to use VMWare to run Linux on
Windows.  You don't have to fear to break something and the speed
within the virtual machine is almost identical to the "real" stuff as
long as you provide enough (virtual) RAM and don't access the hardware
(HD etc.) too often.

As far as your homework is concerned their free trial edition (which
runs for 30 days IIRC) should be OK.

I use Debian but if you want a painless and fast install download
something like SuSE (check the distros supported by VMWare first) and
use that.  You don't even have to burn a CD - VMWare can boot from
.iso files.

Another option - as Kenny has already mentioned - would be to give
Corman Lisp a try.  As long as you only use it for non-commercial
stuff like homework it's free.  But be aware that it has some issues
with respect to the ANSI standard - these shouldn't interfer with your
numerical calculations, though.

HTH,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114545520.731565.249440@z14g2000cwz.googlegroups.com>
>As far as your homework is concerned their free trial edition (which
>runs for 30 days IIRC) should be OK.
This sounds like the simplest solution. I'm going to install Allegro
tonight.
From: drewc
Subject: [OT] easy to install debian via UBUNTU : Re: arithmetic speed
Date: 
Message-ID: <%Rwbe.1136925$Xk.34623@pd7tw3no>
Edi Weitz wrote:

> 
> I use Debian but if you want a painless and fast install download
> something like SuSE (check the distros supported by VMWare first) and
> use that.  You don't even have to burn a CD - VMWare can boot from
> .iso files.

I'm a debian user too, but have been installing using the UBUNTU CD as 
of late. Very easy to install, set up my wifi and my sound without a 
hitch, then i just apt-get dist-upgrade to unstable and i'm done. Best 
of both worlds :).

To the OP: Give UBUNTU a try... there is a live CD as well and it's real 
debian... which matters to some.


-- 
Drew Crampsie
drewc at tech dot coop
"Never mind the bollocks -- here's the sexp's tools."
	-- Karl A. Krueger on comp.lang.lisp
From: Joe Manby
Subject: Re: arithmetic speed
Date: 
Message-ID: <19f54$426eeff4$a228be95$10817@ALLTEL.NET>
"Eric Lavigne" <············@gmail.com> wrote in message 
·····························@f14g2000cwb.googlegroups.com...
> >My understanding is that CLISP doesn't do native floating-point
>>operations, which is going to make it slow in general --- if you care
>>about doing fast floating-point work, you should use a CL that
>>compiles these down to assembly.

> Are there any other CLs that you would recommend?

http://www.cormanlisp.com/features.html
From: Gareth McCaughan
Subject: Re: arithmetic speed
Date: 
Message-ID: <87zmvlw8t8.fsf@g.mccaughan.ntlworld.com>
Eric Lavigne wrote:

>> My understanding is that CLISP doesn't do native floating-point
>> operations, which is going to make it slow in general --- if you care
>> about doing fast floating-point work, you should use a CL that
>> compiles these down to assembly.
> 
> This is rather bad news for me. CMUCL and SBCL don't work on windows.
> LispWorks trial has a heap size limit, works fine when zoomed in on the
> bottleneck but dies if I try to run the whole program. Installing linux
> is not something I can do in an afternoon, and several days of trying
> to optimize have brought me dangerously close to my Thursday deadline.
> Are there any other CLs that you would recommend?

You could try Corman, which has a native compiler but may not
generate such good code as its rivals. Free ("as in beer", not
"as in speech") if you don't need the IDE.

-- 
Gareth McCaughan
.sig under construc
From: Edi Weitz
Subject: Re: arithmetic speed
Date: 
Message-ID: <ud5shfr46.fsf@agharta.de>
On 26 Apr 2005 08:19:09 -0700, "Eric Lavigne" <············@gmail.com> wrote:

> The second looks no more than twice as complicated to me, so more
> than 200 times longer doesn't make sense.  Any ideas?

I haven't really looked at your code but didn't you say you were using
CLISP?  Have you tried running the code with a trial version of
LispWorks or AllegroCL just for comparison?  /Maybe/ you're just
seeing an idiosyncrasy of CLISP.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Eric Lavigne
Subject: Re: arithmetic speed
Date: 
Message-ID: <1114535853.312484.85290@g14g2000cwa.googlegroups.com>
>Have you tried running the code with a trial version of
>LispWorks or AllegroCL just for comparison?

Only after you suggested it. The comparison may be difficult. I suspect
this means I messed up one of the type declarations...

Error: ** Processor Fault #xC0000005 at #x201A8C6B (#<function
SYSTEM::/$DOUBLE$DOUBLE-NONZERO 201A8C62>).