I believe that "long" in this case is 32 bits in C++, and 64-bits in the remaining languages, hence the same result for int and long in C++. Try with "long long" maybe? :)<div><br></div><div><br clear="all">

--<br>Ziad<br>
<br><br><div class="gmail_quote">2011/8/3 Denis Shelomovskij <span dir="ltr"><<a href="mailto:verylonglogin.reg@gmail.com">verylonglogin.reg@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

03.08.2011 18:20, bearophile:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The benchmark info:<br>
<a href="http://chadaustin.me/2011/01/digging-into-javascript-performance/" target="_blank">http://chadaustin.me/2011/01/<u></u>digging-into-javascript-<u></u>performance/</a><br>
<br>
The code, in C++, JS, Java, C#:<br>
<a href="https://github.com/chadaustin/Web-Benchmarks/" target="_blank">https://github.com/chadaustin/<u></u>Web-Benchmarks/</a><br>
The C++/JS/Java code runs on a single core.<br>
<br>
D2 version translated from the C# version (the C++ version uses struct inheritance!):<br>
<a href="http://ideone.com/kf1tz" target="_blank">http://ideone.com/kf1tz</a><br>
<br>
Bye,<br>
bearophile<br>
</blockquote>
<br></div></div>
Compilers:<br>
C++:  cl /O2 /Oi /Ot /Oy /GT /GL and link /STACK:10240000<br>
Java: Oracle Java 1.6 with hm... Oracle default settings<br>
C#:   Csc /optimize+<br>
D2:   dmd -O -noboundscheck -inline -release<br>
<br>
Type column: working scalar type<br>
Other columns: vertices per second (inaccuracy is about 1%) by language (tests from bearophile's message, C++ test is "skinning_test_no_simd.cpp").<br>
<br>
System: Windows XP, Core 2 Duo E6850<br>
<br>
------------------------------<u></u>-----------------------------<br>
  Type  |    C++     |    Java    |     C#     |     D2<br>
------------------------------<u></u>-----------------------------<br>
float   | 31_400_000 | 17_000_000 | 14_700_000 |    168_000<br>
double  | 32_300_000 | 16_000_000 | 14_100_000 |    166_000<br>
real    | 32_300_000 |   no real  |   no real  |    203_000<br>
int     | 29_100_000 | 14_600_000 | 14_100_000 | 16_500_000<br>
long    | 29_100_000 |  6_600_000 |  4_400_000 |  5_800_000<br>
------------------------------<u></u>-----------------------------<br>
<br>
JavaScript vs C++ speed is at the first link of original bearophile's post and JS is about 10-20 temes slower than C++.<br>
Looks like a spiteful joke... In other words: WTF?! JavaScript is about 10 times faster than D in floating point calculations!? Please, tell me that I'm mistaken.<br>
</blockquote></div><br></div>