Fib: C++, C# and GDC

As a reference implementation, I added C++ one:


It's execution time is 1.33 seconds, which surprisingly is not the best result so far.
A C# version:

Also, I compiled this D code with GDC compiler and it executed in 990 ms, which is the best result:

  • D (GDC) - 0.990
  • C# - 1.26
  • D (DMD) - 1.3
  • C++ - 1.33
  • F# - 1.38
  • Nemerle - 1.45
  • Rust - 1.66
  • Go - 2.38
  • Haskell - 2.8
  • Clojure - 9
  • Erlang - 17
  • Ruby - 60
  • Python - 120

Unfortunately, I have not managed to compile the D code with LDC compiler, it returns the following error:

Building: DFib (Release)
Performing main compilation...
Current dictionary: d:\git\DFib\DFib
D:\ldc2-0.15.2-beta1-win64-msvc\bin\ldc2.exe -O3 -release "main.d"   "-od=obj\Release" "-of=d:\git\DFib\DFib\bin\Release\DFib.exe"
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
Error: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe failed with status: 1181
Exit code 1181

Comments

Popular posts from this blog

Upcoming F# struct tuples: are they always faster?

Computing cryptography hashes: Rust, F#, D and Scala

Composing custom error types in F#