Re: [isabelle] 64-bit Java is 6x faster than 32-bit for a recursive fibonacci



[re-sending from jlm—-r]


More generally, if you are really trying to benchmark various languages and implementations,
you might want to consider a broader suite of tests.   E.g., within the lisp world, you could
look at Dick Gabriel’s “Performance and Evaluation of Lisp Systems”  from around 1985.
(http://www.dreamsongs.com/NewFiles/Timrep.pdf)

In particular, if your focus is on function call overhead, the TAK and PUZZLE tests might
be of interest, including the variants that move things around to account for cache lines.

  jlm

On May 17, 2014, at 4:15 PM, James McDonald <mcdonald at kestrel.edu> wrote:

> To get the best timing, I turned up the optimization settings and fully typed everything.
> I also used the labels construct to make the recursive calls local, which trimmed about
> 0.4 seconds.
> 
> On a newer Macbook Pro (2.6 GHz) the timing with fixnums was 2.09 seconds,
> using 5.4 billion cycles, and and with integers it was 4.85 seconds using 12.6 
> billion cycles.   [The (debug 0) setting had no effect on the fixnum code, but shaved
> 0.6 seconds off the integer code.]
> 
> (As an aside, note that with SBCL on a 64-bit machine, most-positive-fixnum is 
> 4611686018427387903, which would be between (fib 90) and (fib 91). )
> 
> (in-package :cl-user)
> 
> (proclaim '(optimize (speed 3) (safety 0) (space 0) (debug 0) (compilation-speed 0)))
> 
> (defun fib (n) 
>   (declare (fixnum n))
>   (labels ((aux (n) 
>              (declare (fixnum n))
>              (the fixnum
>                (if (< n 2) 
>                    n 
>                    (+ (the fixnum (aux (the fixnum (- n 1))))
>                       (the fixnum (aux (the fixnum (- n 2)))))))))
>     (aux n)))
> 
> 
> 
> 
> On May 16, 2014, at 4:48 PM, Gottfried Barrow <igbi at gmx.com> wrote:
> 
>> On 14-05-16 11:26, Richard Waldinger wrote:
>>> 
>>>>> From: James McDonald <mcdonald at kestrel.edu>
>>>>> Subject: Re: speed of functional language implementations
>>>>> Date: May 15, 2014 at 1:11:05 PM PDT
>>>>> To: Richard Waldinger <waldinger at AI.SRI.COM>
>>> 
>>>> On a Macbook Pro (2.3 GHz)  I get 2.4 seconds for fully optimized SBCL, using fixnums.
>>>> If I use integers instead, it is 7.8 seconds.
>> 
>> Richard,
>> 
>> Thanks for the info from James McDonald. I was confused about SBCL. I had installed it, but I thought the instructions on how to build it was part of what to do to compile a script. When sorting through 20 languages, unfamiliarity and some resistance can cause me to abandon testing a language out.
>> 
>> This worked out better, because I hadn't downloaded the newest version for Windows.
>> 
>> With SBCL on Windows, with the default options, I get 5.6 seconds for fixnum, and 9.8 seconds for integer. I'm running a 2.8GHz old quad core, where it only utilizes 25% of the cpu when it's running the program.
>> 
>> Where SBCL really separates itself is with big integers, because fib(42) is only 4807526976. That wasn't forcing these other languages to use non-machine integers, the ones that don't make you choose. I say more about that in my reply to Makarius.
>> 
>> Regards,
>> GB
>> 
>> 
> 




This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.