I recently noticed that F # Interactive is much faster than the compiled version (in Release or Debug mode). Here is an example:
let rec fib n = if n < 3 then 1 else fib (n-1) + fib (n-2) [<EntryPoint>] let rec main argv = let w = System.Diagnostics.Stopwatch() w.Start() fib 45 w.Stop() printfn "%d" w.ElapsedMilliseconds System.Console.ReadLine() 0
When compiling in release mode, execute these outputs “12784” when “4986” comes out in F # Interactive. I run it interactively using "main [||] ;;".
Something strange is definitely happening, but I have no idea what!
EDIT [Specs]: F # 3.0 for .NET 4. Code optimization is installed and flag flags are generated, and I am compiling for x86. I am running this on the i7 950. I am using visual studio 2012.
source share