Why is this simple F# code 36 times slower than C#/C++ versions?
<p>I've written a simple test, which creates a variable, initializes it with zero and increments 100000000 times.</p>

<p>C++ does it in 0.36 s. Original C# version in 0.33s New in 0.8s  F# in 12 seconds. </p>

<p>I don't use any functions, so the problem is not with generics by default</p>

<p>F# code</p>

<pre><code>open System
open System.Diagnostics
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
[&lt;EntryPoint&gt;]
let main argv = 
    let N = 100000000
    let mutable x = 0
    let watch = new Stopwatch();
    watch.Start();
    for i in seq{1..N} do
        x &lt;- (x+1)
    printfn "%A" x
    printfn "%A" watch.Elapsed
    Console.ReadLine()
        |&gt; ignore
    0 // return an integer exit code
</code></pre>

<p>C++ code</p>

<pre><code>#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
#include&lt;vector&gt;
#include&lt;iostream&gt;
#include&lt;time.h&gt;
using namespace std;
int main()
{
    const int N = 100000000;
    int x = 0;
    double start = clock();
    for(int i=0;i&lt;N;++i)
    {
        x = x + 1;
    }
    printf("%d\n",x);
    printf("%.4lf\n",(clock() - start)/CLOCKS_PER_SEC);
    return 0;
}
</code></pre>

<p>C# code</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace SpeedTestCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            const int N = 100000000;
            int x = 0;
            Stopwatch watch = new Stopwatch();
            watch.Start();

            foreach(int i in Enumerable.Range(0,N))
            //Originally it was for(int i=0;i&lt;N;++i)
            {
                x = x + 1;
            }
            Console.WriteLine(x);
            Console.WriteLine(watch.Elapsed);
            Console.ReadLine();
        }
    }
}
</code></pre>

<p><strong>Edit</strong></p>

<p>Replacing <code>for (int i = 0; i &lt; N; ++i)</code> with <code>foreach(int i in Enumerable.Range(0,N))</code> makes C# program to run in about 0.8s, but it's still much faster than f#</p>

<p><strong>Edit</strong></p>

<p>Replaced <code>DateTime</code> with <code>StopWatch</code> the for F#/C#. Results are the same</p>