C# Hashtable vs c++ hash_map
<p>I'm comparing the following code in C++ and C# and C# (Mono 2.4) seems to be faster. Is there anything wrong with the C++ code?</p>

<pre><code> #include &lt;map&gt;
 #include &lt;string&gt;
 #include &lt;iostream&gt;
 #include &lt;ext/hash_map&gt;
 #include &lt;boost/any.hpp&gt;

 int main()
 {
    //std::map&lt;long, long&gt; m;
    // hash_map is a little bit faster
    __gnu_cxx::hash_map&lt;long, long&gt; m;

    for( long i = 0; i &lt; 1000000; ++i )
    {
        m[i]  = i;
    }

 }
</code></pre>

<p>And C#</p>

<pre><code> using System;
 using System.Collections;

 public int Main()
 {
     Hashtable m = new Hashtable();

     for( long i = 0; i &lt; 1000000; ++i )
     {
        m[i]  = i;
     }

}
</code></pre>

<p>C# code is actually twice as fast on the same machine.</p>

<pre><code>$ time ./a.out

real    0m1.028s
user    0m0.986s
sys     0m0.041s

$ time mono test.exe

real    0m0.603s
user    0m0.732s
sys     0m0.090s
</code></pre>
