Re: SBCL performance on OS X
- From: Christophe Rhodes <csr21@xxxxxxxxx>
- Date: Tue, 06 Dec 2005 09:00:23 +0000
William Bland <doctorbill.news@xxxxxxxxx> writes:
> I've been playing around for a while with close-to-out-of-memory
> situations in Lisp. As part of this investigation, I wrote a very simple
> program that just gobbles up memory until the Lisp process dies.
>
> Running this program seems to show an incredible disparity between the
> speed of SBCL on Linux, and on OS X.
No, it doesn't. Judging by your weblog entry, it shows a disparity
between the speed of SBCL on an x86 and on a powerpc. That is, I
would expect SBCL on OS X/x86 (when such a beast appears) to perform
similarly to SBCL on any other OS on the x86, while I would expect
SBCL on Linux/ppc to perform similarly to SBCL on OS X/ppc.
> On Linux, the program dies after less than a second, having
> allocated around 520MB. On my Powerbook the same program takes 1
> minute 13 seconds to allocate the same amount of memory!
The garbage collection implementations on x86-family machines and
non-x86es for SBCL are completely different. The non-x86 machines use
a simple Cheney semi-space collector, which is relatively efficient
when almost all data is garbage and very inefficient when almost all
data is live: specifically, garbage collection time is proportional to
the amount of live data. x86es use a mostly-copying (conservative)
generational collector, supported by a write barrier, which
empirically has much more even performance over a range of datasets,
and rarely needs to do a full collection; for semispace collectors,
every collection is a full collection. If you want to allocate memory
more quickly, try setting (bytes-consed-between-gcs) to something
larger than its default value: say 100Mb.
As for why: there is no fundamental reason, but the longer history of
a development-friendly x86 platform than that of a powerpc platform
seems to have encouraged garbage collection optimizations for the x86
from contributors, who for the most part (but not exclusively) work
independently of commercial incentives. It would take a small amount
of sustained effort to port the garbage collector and allocator to a
non-x86 platform.
Christophe
.
- Follow-Ups:
- Re: SBCL performance on OS X
- From: Christophe Rhodes
- Re: SBCL performance on OS X
- From: Thomas F. Bur***
- Re: SBCL performance on OS X
- From: André Thieme
- Re: SBCL performance on OS X
- References:
- SBCL performance on OS X
- From: William Bland
- SBCL performance on OS X
- Prev by Date: Re: SBCL performance on OS X
- Next by Date: Re: ECL/Qt demo for Win32
- Previous by thread: Re: SBCL performance on OS X
- Next by thread: Re: SBCL performance on OS X
- Index(es):