[Openmcl-devel] [info-mcl] Performance differences between 5.1 and 5.2.1

Alexander Repenning ralex at cs.colorado.edu
Tue Mar 23 08:54:25 PDT 2010


It is hard to talk about a general case but overall MCL 5.2.1 is definitely slow. Interestingly, more complex applications, e.g., simulations with 3D visualization will run about at the same speed on a 1.6 Ghz PPC mac and a 2.6 Ghz Intel mac. The overall loss in CPU speed hampered by Rosetta gets basically compensated with the faster CPU and the much faster GPU.

I would be careful to use empty loops as predictors for application speed. Below is an array shuffle function which runs about 13x faster on the same intel mac in CCL 1.4 compared to MCL 5.2.1. The "same" code in JavaScript on Chrome (same machine) will run about 40% slower than CCL 1.4 which is still almost 10x faster than MCL 5.2.1. 



(defun MAKE-SORTED-ARRAY (n)
 (let ((Array (make-array n)))
   (dotimes (i n Array) 
     (setf (svref Array i) i))))

;(make-sorted-array 100)


(defun SHUFFLE (Array)
 (let ((N (array-dimension Array 0)))
   (loop
     (when (<= N 1) (return Array))
     (rotatef (svref Array (random n)) (svref Array (decf n))))))


(let ((A (make-sorted-array 1000000)))
 (time (progn (shuffle A) nil)))



(shuffle (make-sorted-array 1000000))







On Mar 22, 2010, at 1:29 PM, wws2 new wrote:

> Hi Sandro,
> 
> I also experience a significant performance degradation, perhaps even larger than what you report, as I go between  MCL on a PPC and RMCL on Snow Leopard, the second being much slower despite being on a much faster and more recent chipset.
> 
> Some months ago I noticed that (time (dotimes (i x)) can vary significantly for various values of x between MCL and RMCL.  IIRC, somewhere around bignums things really slow down. 
> 
>  Welcome to Macintosh Common Lisp Version 5.2.1!
> 
> ? (time (dotimes (i 1000000)))
>  (DOTIMES (I 1000000)) took 15 milliseconds (0.015 seconds) to run.
>  Of that, 1 milliseconds (0.001 seconds) were spent in The Cooperative Multitasking Experience.
>  NIL
> 
> ? (time (dotimes (i 1000000000)))
>  (DOTIMES (I 1000000000)) took 455,771 milliseconds (455.771 seconds) to run.
>  Of that, 136,552 milliseconds (136.552 seconds) were spent in The Cooperative Multitasking Experience.
>  2,495 milliseconds (2.495 seconds) was spent in GC.
>   7,410,336,440 bytes of memory allocated.
>  NIL
> 
> on a Power PPC with MCL, these take 0.002 seconds (7 times faster) and 209 seconds (about 2.5 times as fast) but only 1.2 seconds in CME and 4.2 in GC
> 
> ? (time (dotimes (i MOST-POSITIVE-FIXNUM)))
>  (DOTIMES (I MOST-POSITIVE-FIXNUM)) took 7,985 milliseconds (7.985 seconds) to run.
>  Of that, 3 milliseconds (0.003 seconds) were spent in The Cooperative Multitasking Experience.
>   5,776 bytes of memory allocated.
>  NIL
> 
> ? MOST-POSITIVE-FIXNUM
>  536870911
> 
> ?   
> 
> As a result of this general slowness, I use my PPC machines for development, but have at least ported everything to RMCL on a new machine for the day when my old machines stop working.  
> 
> I also have my non-GUI code running on Clozure, hoping that an IDE and GUI layer eventually mature.   As to speed, my non-GUI code can be as much as 60-100 times faster under CCL than RMCL running on the same Intel machine.     One particularly slow routine which collects data stored in hash-tables (fast under CCL?) and writes around 500Meg to a stream to disk (slow under RMCL) takes 29 seconds on Clozure and around an hour under RMCL (and maybe 9 minutes on PPC-MCL).  Have not tried to figure out what the bottleneck is yet, but it must be something in streams or system-IO. 
> 
> BTW under CCL:
> 
> Welcome to Clozure Common Lisp Version 1.4-r13119  (DarwinX8664)!
> ? MOST-POSITIVE-FIXNUM
> 1152921504606846975
> ?  So let's not try that, it will take forever as well 
> 
> ? (time (dotimes (i 1000000)))
> (DOTIMES (I 1000000)) took 486 microseconds (0.000486 seconds) to run 
>                    with 2 available CPU cores.
> During that period, 715 microseconds (0.000715 seconds) were spent in user mode
>                    34 microseconds (0.000034 seconds) were spent in system mode
> NIL
> ? (time (dotimes (i 1000000000)))
> (DOTIMES (I 1000000000)) took 530,609 microseconds (0.530609 seconds) to run 
>                    with 2 available CPU cores.
> During that period, 533,194 microseconds (0.533194 seconds) were spent in user mode
>                    675 microseconds (0.000675 seconds) were spent in system mode
> NIL
> ? 
> 
> Walker
> 
> 
> On Mar 22, 2010, Sandro Pedrazzini <sandro.pedrazzini at canoo.com> wrote:
> 
>> 
>> 
>> Hi,
>> 
>> I noticed (and measured) an important performance difference between my application running on RMCL 5.1 and the same application running on 5.2.1.
>> Only loading all the application code, from a fresh RMCL delivery, it takes on 5.2.1 almost twice as much as in 5.1.  Then, every functionality is slower on 5.2.1 and for some specific application tasks I could even measure a difference of a factor 4.
>> 
>> I was wondering if someone else is having such performance problems with 5.2.1
>> 
>> In both cases I am using a 1 GB dump, which, btw, on version 5.2.1 shows such warning on the listener:
>> 
>> Welcome to Macintosh Common Lisp Version 5.2.1!
>> ; Warning: Requested 1073741824 bytes of heap. Max is 1073000000 bytes.
>> ; While executing: CCL::CHECK-CARBONLIB-VERSION
>> ?
>> 
>> 
>> Is there a connection?
>> 
>> 
>> best regards
>> Sandro
>> 
>> 
> 
> _______________________________________________
> info-mcl mailing list
> info-mcl at clozure.com
> http://clozure.com/mailman/listinfo/info-mcl

Prof. Alexander Repenning

University of Colorado
Computer Science Department
Boulder, CO 80309-430

vCard: http://www.cs.colorado.edu/~ralex/AlexanderRepenning.vcf





More information about the Openmcl-devel mailing list