03.08.2011 18:20, bearophile:
The benchmark info:
http://chadaustin.me/2011/01/digging-into-javascript-performance/

The code, in C++, JS, Java, C#:
https://github.com/chadaustin/Web-Benchmarks/
The C++/JS/Java code runs on a single core.

D2 version translated from the C# version (the C++ version uses struct 
inheritance!):
http://ideone.com/kf1tz

Bye,
bearophile

Compilers:
C++:  cl /O2 /Oi /Ot /Oy /GT /GL and link /STACK:10240000
Java: Oracle Java 1.6 with hm... Oracle default settings
C#:   Csc /optimize+
D2:   dmd -O -noboundscheck -inline -release

Type column: working scalar type
Other columns: vertices per second (inaccuracy is about 1%) by language (tests from bearophile's message, C++ test is "skinning_test_no_simd.cpp").

System: Windows XP, Core 2 Duo E6850

-----------------------------------------------------------
  Type  |    C++     |    Java    |     C#     |     D2
-----------------------------------------------------------
float   | 31_400_000 | 17_000_000 | 14_700_000 |    168_000
double  | 32_300_000 | 16_000_000 | 14_100_000 |    166_000
real    | 32_300_000 |   no real  |   no real  |    203_000
int     | 29_100_000 | 14_600_000 | 14_100_000 | 16_500_000
long    | 29_100_000 |  6_600_000 |  4_400_000 |  5_800_000
-----------------------------------------------------------

JavaScript vs C++ speed is at the first link of original bearophile's post and JS is about 10-20 temes slower than C++. 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.

Reply via email to