Optimization question
Is it possible to speed-up this code?
(defvar *global* 50)
(defun test (number iteration)
(declare (optimize (speed 3) (safety 0) (debug 0) (space 0)))
(declare (type (complex double-float) number))
(or (> (the fixnum iteration) (the fixnum *global*))
(> (the double-float (abs number)) 2.0d0)))
(defun test-times (iterations)
(time (dotimes (x iterations) (test #c(0.5d0 0.8d0) 40))))
On LWM 5.0.1 Personal (Intel):
(time (test-times 10000000))
Timing the evaluation of (TEST-TIMES 10000000)
User time = 9.557
System time = 0.051
Elapsed time = 13.963
Allocation = 800075272 bytes
0 Page faults
On SBCL on the same machine:
Evaluation took:
0.803 seconds of real time
0.794847 seconds of user run time
0.0015 seconds of system run time
0 calls to %EVAL
0 page faults and
0 bytes consed.
SBCL seems to be more than 10 times faster. Am I missing something? I
double-checked that the functions are compiled.
Thanks,
Michal