From a C++/JS benchmark

Ziad Hatahet hatahet at gmail.com
Wed Aug 3 12:15:37 PDT 2011


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? :)


--
Ziad


2011/8/3 Denis Shelomovskij <verylonglogin.reg at gmail.com>

> 03.08.2011 18:20, bearophile:
>
>  The benchmark info:
>> http://chadaustin.me/2011/01/**digging-into-javascript-**performance/<http://chadaustin.me/2011/01/digging-into-javascript-performance/>
>>
>> The code, in C++, JS, Java, C#:
>> https://github.com/chadaustin/**Web-Benchmarks/<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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110803/22409f3a/attachment.html>


More information about the Digitalmars-d mailing list