[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Benchmarks



Using heavy type declarations can gets your example down to 66 msec on
a Quadra 950 (my other times were about the same as yours).  To try
this, just define the macros below and replace all the arithmetic
functions (- and < in the case of tak) with the corresponding
fixnum-typed operators (-& and <&).  The MCL compiler can generate
pretty tight code if you give it enough information, and macros make it
possible to do that relatively painlessly.

More of this sort of thing can be found in the file mt-utils.lisp on the CDROM.  



(defmacro def-fixnum-op (int-name reg-name &optional (result-type 'fixnum))
  `(defmacro ,int-name (&rest args)
     `(the ,',result-type (,',reg-name ,@(mapcar #'(lambda (arg) `(the fixnum ,arg)) args)))))
 
(def-fixnum-op +& +)                     ; Only addition-type ops actually get any boost in MCL2.0
(def-fixnum-op -& -)
(def-fixnum-op incf& incf)
(def-fixnum-op decf& decf)
(def-fixnum-op 1+& 1+)
(def-fixnum-op 1-& 1-)
(def-fixnum-op =& = atom)
(def-fixnum-op <& < atom)
(def-fixnum-op <=& <= atom)
(def-fixnum-op >& > atom)
(def-fixnum-op >=& >= atom)
(def-fixnum-op zerop& zerop atom)