[Openmcl-devel] CCL and the new intel processors
Alexander Repenning
ralex at cs.colorado.edu
Fri Sep 17 21:47:19 PDT 2010
On Sep 17, 2010, at 7:26 PM, Ron Garret wrote:
> I'm buying a new Mac. The current lineup includes Core2 duos, Core i3, i5 and i7 processors, with the iX processors generally more expensive than the 2's. Are they worth it in terms of running CCL? Will the Core iX processors run CCL appreciably faster than a Core 2? (Will CCL even run on these new processors?)
>
> rg
>
The i7 mobiles in MacBook Pros have only 2 real cores but hyper threading. The regular i7 has 4 physical cores.
You can run some experiments with code. Here are some older quick hacks. On a 2.66 Ghz i7 MacBook Pro I get:
Threads Cycles
1 800
2 1400
3 1600
4 1650
As you can see quite a bit of speed up with the physical cores, i.e., 1 -> 2 but little added value with the hyperthreading. Of course, this is just a silly benchmark but it does show that there can be good speedup. Be careful when running this code. This will spin up your cores up to the max. On the MacBook I get 390% CPU use.
alex
;; ------------------------------
(in-package :ccl)
(defparameter *Sum* 0)
(defparameter *Sum-Lock* (make-lock "sum lock"))
(defun ! (n)
(if (zerop n) 1 (* n (! (1- n)))))
(defun BURN-CPU ()
(let ((s 0) (n 10000))
(dotimes (i n (/ s n))
(incf s (random 1000.0)))))
(defparameter *P1*
(process-run-function "p1" #'(lambda ()
(loop
(burn-cpu)
(with-lock-grabbed (*Sum-Lock*)
(incf *Sum*))))))
(defparameter *P2*
(process-run-function "p2" #'(lambda ()
(loop
(burn-cpu)
(with-lock-grabbed (*Sum-Lock*)
(incf *Sum*))))))
(defparameter *P3*
(process-run-function "p3" #'(lambda ()
(loop
(burn-cpu)
(with-lock-grabbed (*Sum-Lock*)
(incf *Sum*))))))
(defparameter *P4*
(process-run-function "p4" #'(lambda ()
(loop
(burn-cpu)
(with-lock-grabbed (*Sum-Lock*)
(incf *Sum*))))))
(defparameter *Progress*
(process-run-function "progress" #'(lambda ()
(loop
(let ((Sum *Sum*))
(sleep 1.0)
(format t "~%speed=~A [incf/s]" (- *Sum* Sum)))))))
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
More information about the Openmcl-devel
mailing list