[Openmcl-devel] Another 32/64-bit Example -- RayTrace

Brent Fulgham bfulg at pacbell.net
Sun Oct 29 20:30:40 PST 2006


Attached is a Lisp implementation of a simple raytracer that produces  
the attached (somewhat cheesy) image for your amusement.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ray.lisp
Type: application/octet-stream
Size: 5110 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20061029/c933874a/attachment.obj>
-------------- next part --------------

At any rate, if you run this program under the various Lisps, we can  
see a few differences:

=========================
Case 1:  PPC32 (OpenMCL 1.0)
=========================
? (time (main 8 "output.ppm" 400))
(MAIN 8 "output.ppm" 400) took 295,796 milliseconds (295.796 seconds)  
to run.
Of that, 186,475 milliseconds (186.475 seconds) were spent in user mode
          63,023 milliseconds (63.023 seconds) were spent in system mode
          46,298 milliseconds (46.298 seconds) were spent executing  
other OS processes.
31,355 milliseconds (31.355 seconds) was spent in GC.
47,547,202,264 bytes of memory allocated.
NIL

=========================
Case 2:  PPC32 (OpenMCL 1.1)
=========================
? (time (main 8 "output11.ppm" 400))
 > Error: FLOATING-POINT-OVERFLOW detected
 >        performing * on (-3.0289955392645377D+285  
-3.0289955392645377D+285)
 > While executing: CCL::*-2, in process listener(1).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
1 >

=========================
Case 3: PPC64 (OpenMCL 1.1)
=========================
#P"/Users/brent/Projects/Lisp/ray.lisp"
? (time (main 8 "output64.ppm" 400))
(MAIN 8 "output64.ppm" 400) took 245,375 milliseconds (245.375  
seconds) to run.
Of that, 175,974 milliseconds (175.974 seconds) were spent in user mode
          29,113 milliseconds (29.113 seconds) were spent in system mode
          40,288 milliseconds (40.288 seconds) were spent executing  
other OS processes.
16,202 milliseconds (16.202 seconds) was spent in GC.
47,586,204,016 bytes of memory allocated.
NIL
?

=========================
Case 4: SBCL (32-bit)
=========================
* (time (main 8 "outputsbcl.ppm" 400))

Evaluation took:
   27.511 seconds of real time
   11.886907 seconds of user run time
   7.56218 seconds of system run time
   [Run times include 0.797 seconds GC run time.]
   0 calls to %EVAL
   0 page faults and
   2,882,202,560 bytes consed.
NIL
*

I'm confused by Case 2.  Most likely there is a bug in the ray  
tracer, but it's odd that it worked under OpenMCL 1.0, and works  
under OpenMCL 1.1 (64-bit).

Also a bit disappointing is that SBCL is roughly 10x as fast as any  
version of OpenMCL on this little test.  :-(

Thanks,

-Brent

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sphere.png
Type: application/applefile
Size: 65811 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20061029/c933874a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sphere.png
Type: image/png
Size: 27840 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20061029/c933874a/attachment.png>


More information about the Openmcl-devel mailing list