RE: Floating-point performance
"Ernst van Waning" <[email protected]> Wed, 11 May 2005 18:33:25 +0200
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Organization | Infometrics |
| Message-ID | <000501c55647$2aa17be0$ed7e74d5@PORTABLEErnst> |
Hello Nicolas, Not that this answers your question, but someone else's results may be informative. Just ran your code exectly as you sent it in ACLv7 (International Allegro CL Professional Edition 7.0 [Windows] (May 11, 2005 17:38)). The results were: ; cpu time (non-gc) 1,783 msec user, 10 msec system ; cpu time (gc) 0 msec user, 0 msec system ; cpu time (total) 1,783 msec user, 10 msec system ; real time 2,113 msec ; space allocation: ; 12 cons cells, 240,000 other bytes, 0 static bytes ; cpu time (non-gc) 2,303 msec user, 10 msec system ; cpu time (gc) 0 msec user, 0 msec system ; cpu time (total) 2,303 msec user, 10 msec system ; real time 2,794 msec ; space allocation: ; 12 cons cells, 0 other bytes, 0 static bytes The results above show much less consing than what you reported. I don't know why this is, but it may have to do with the version of Allegro you have used. My machine is a HP omnibook xe 4500, with a 1.6Mhz processor and 256Mb of RAM (of which 286Mb was in use) running Windows XP Professional. Test with an "empty" machine (253 Mb in use) gave very similar results. To have some way to compare runtime results, it may be good if you include your FLOP-counter in your code. For the rest, I don't see any glaring omissions that could speed up your code :-) Kind regards, Ernst van Waning > -----Original Message----- > From: Nicolas Neuss [mailto:[email protected]] > Sent: 09 May 2005 23:07 > To: [email protected] > Subject: Floating-point performance > > > Hello, Allegro experts, > > I am just testing if Allegro CL would be a suitable host for > my PDE simulation tool Femlisp. One necessity would be that > floating point arithmetic is fast. I assume that Allegro is > able to satisfy this need, because I remember an earlier > article of Richard Fateman reporting fast fp arithmetic with > Allegro. However, at the moment I observe a factor 5 of > speed between Allegro and CMUCL. Which declaration do I > miss? I have played around a bit with (declare (:explain > :calls :types)) but unfortunately with little insight. > > Thank you for any information, > > Nicolas. > > -------------------------------------------------------------- > ------------- > The test code and the timing results: > -------------------------------------------------------------- > ------------- > (let ((ddot > (compile nil > (lambda (x y n) > (declare (type fixnum n) > (type (simple-array double-float (*)) x y)) > (declare (optimize (safety 0) (space 0) > (debug 0) (speed > 3))) > (loop for i of-type fixnum from 0 below n > summing (* (aref x i) (aref y i)) of-type > double-float)))) > (daxpy > (compile nil > (lambda (x y n) > (declare (type fixnum n) > (type (simple-array double-float (*)) x y)) > (declare (optimize (safety 0) (space 0) > (debug 0) (speed > 3))) > (dotimes (i n) > (incf (aref y i) (* 3.0d0 (aref x i)))))))) > (let* ((size 10000) (repetitions (/ 100000000 size)) > (a (make-array size :element-type 'double-float > :initial-element > 0.0d0)) > (b (make-array size :element-type 'double-float > :initial-element > 0.0d0))) > (flet ((test (f) > (time (loop repeat repetitions do (funcall f a b > size))))) > (test ddot) > (test daxpy)))) > > ;;;; CMUCL results > > ; Evaluation took: > ; 1.07 seconds of real time > ; 0.99 seconds of user run time > ; 0.0 seconds of system run time > ; 640,581,017 CPU cycles > ; 0 page faults and > ; 1,120,104 bytes consed. > > ; Evaluation took: > ; 1.4 seconds of real time > ; 1.34 seconds of user run time > ; 0.0 seconds of system run time > ; 840,576,216 CPU cycles > ; 0 page faults and > ; 960,104 bytes consed. > ; > > ;;;; Allegro results > > ; cpu time (non-gc) 5,620 msec user, 0 msec system > ; cpu time (gc) 40 msec user, 0 msec system > ; cpu time (total) 5,660 msec user, 0 msec system > ; real time 5,831 msec > ; space allocation: > ; 160,123 cons cells, 240,256 other bytes, 7,832 static > bytes ; cpu time (non-gc) 8,220 msec user, 0 msec system > ; cpu time (gc) 10 msec user, 0 msec system > ; cpu time (total) 8,230 msec user, 0 msec system > ; real time 8,454 msec > ; space allocation: > ; 160,123 cons cells, 232 other bytes, 0 static bytes > >