Go to Google Groups Home    comp.lang.lisp
Re: Very poor Lisp performance

Jon Harrop <use...@jdh30.plus.com>

Juho Snellman wrote:
> <use...@jdh30.plus.com> wrote:
>>>> My system is an unladen 900MHz Athlon T-bird with 768Mb RAM running
>>>> Debian testing with SBCL 0.8.16 and CMUCL "19b-release-20050628-3 +
>>>> minimal debian patches".

> That's a rather ancient version of SBCL, you might want to upgrade.

Debian unstable has 0.9.3. It's upgrading now... :-)

> For example:

>> (defstruct (vec (:conc-name nil) (:constructor vec (x y z)))
>>   (x 0.0 :type single-float)
>>   (y 0.0 :type single-float)
>>   (z 0.0 :type single-float))

> This is using about 2x the memory of what you'd expect for each
> instance, and doing an extra memory indirection for each slot access.
> Proper support for storing the floats "raw" in the struct was added in
> 0.9.2 by David Lichteblau.

I see.

> Another possible pitfall on older SBCLs (<0.8.21) is that they don't
> honor the compiler policy for code entered on the repl, but compile it
> with low speed, high debug/safety. If you've been pasting the code
> into the repl instead of LOADing it, performance would indeed be
> horrible.

Aha! Yes indeed. I just tried (load (compile-file "...")) and it runs in
only 20secs compared to ~250secs from the top-level and 2.5secs for C++.

Thanks for the help. I'll repost when I get results with the new compiler.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com