Urabe Shyouhei said:
Are those executables compiled with identical compilers + compile flags?
The question is understandable, but these implementation might very
well be written in different languages, so it doesn't really matter.
We can assume that they are as much as possible, if they come from a
common distribution.
I added a comment to the web site, but I'm not sure it was taken into
account (I didn't got the same feed back as for a second shorter
comment). So here it is again:
For completeness, could you please try Common Lisp too?
You could use sbcl 1.0.29 (MS-Windows port in progress) at:
http://prdownloads.sourceforge.net/sbcl/sbcl-1.0.29-x86-windows-binary.msi
-------(bench1.lisp)----------------------------------------------------
(declaim (optimize (speed 3) (space 2) (debug 0) (safety 0)))
(declaim (ftype (function (single-float single-float) fixnum) iterate))
(defparameter *bailout* 16.0)
(defparameter *max-iterations* 1000)
(defun bench1 ()
(format t "Rendering...~%") (force-output)
(loop :for y fixnum :from -39 to 39 :do
(terpri)
(loop :for x fixnum :from -39 to 39 :do
(princ (if (zerop (iterate (the single-float (/ x 40.0))
(the single-float (/ y 40.0))))
"*"
" "))))
(finish-output))
(defun iterate (x y)
(declare (single-float x y))
(loop
:with cr single-float = (- y 0.5)
:with ci single-float = x
:with zi single-float = 0.0
:with zr single-float = 0.0
:for i fixnum :from 0 :below *max-iterations*
:do (let ((temp (* zr zi))
(zr2 (* zr zr))
(zi2 (* zi zi)))
(declare (single-float temp zr2 zi2))
(setf zr (+ (- zr2 zi2) cr)
zi (+ temp temp ci))
(when (< (the single-float *bailout*) (the single-float (+ zi2 zr2)))
(return-from iterate i)))
:finally (return-from iterate 0)))
(time (bench1))