[Openmcl-devel] consing iterating through a loop
Cyrus Harmon
ch-openmcl at bobobeach.com
Thu Jan 27 09:23:08 PST 2005
Randy et al.,
This is, of course, very cool, but I'd like to point out that other
implementations such as SBCL (SBCL on PPC) don't cons on this example.
Clearly different compilers have strengths and weaknesses and OpenMCL
is great at a lot of things. While use fpc-ppc is a reasonable answer,
two other alternatives come to mind. First, I'm by no means an expert
in lisp compiler declarations, so it seemed reasonable that there might
be something I was forgetting here that would keep OpenMCL from
consing. Second, assuming all the declare options are correct, is there
anything that can be done in the compiler to fix this? I know Gary
Byers has better things to do than explain compiler internals to folks
like me all day, but if anyone knows why we're consing here, I'd love
to hear the answer.
Thanks,
Cyrus
On Jan 27, 2005, at 5:37 AM, Randall Beer wrote:
> Cyrus,
>
> This is pretty much the kind of thing that FPC-PPC
> (http://vorlon.cwru.edu/~beer/index.html#software) was written for:
>
> ? (flet ((foo ()
> (declare (optimize (speed 3) (safety 0) (space 0)))
> (let ((z 2.0d0))
> (WITH-TEMP-DOUBLE-FLOATS (a)
> (dotimes (i 500000)
> (declare (fixnum i))
> (%SET-DOUBLE! a (+ a z)))
> (%COPY-FLOAT a)))))
> (time (foo)))
>
> (FOO) took 16 milliseconds (0.016 seconds) to run.
> Of that, 20 milliseconds (0.020 seconds) were spent in user mode
> 0 milliseconds (0.000 seconds) were spent in system mode
> 16 bytes of memory allocated.
> 1000000.0D0
>
> Randy
>
>
> On Jan 26, 2005, at 8:01 PM, Cyrus Harmon wrote:
>
>> In OpenMCL:
>>
>> (FOO) took 760 milliseconds (0.760 seconds) to run.
>> Of that, 150 milliseconds (0.150 seconds) were spent in user mode
>> 50 milliseconds (0.050 seconds) were spent in system mode
>> 560 milliseconds (0.560 seconds) were spent executing other
>> OS processes.
>> 361 milliseconds (0.361 seconds) was spent in GC.
>> 8,000,000 bytes of memory allocated.
>>
>> 1000000.0D0
>
More information about the Openmcl-devel
mailing list