math.log() benchmark of first 1 billion int using std.parallelism

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 22 03:09:14 PST 2014


On Mon, 2014-12-22 at 10:12 +0000, Iov Gherman via Digitalmars-d-learn wrote:
> […]
> - D: 24 secs, 32 ms.
> - Java: 20 secs, 881 ms.
> - C: 21 secs
> - Go: 37 secs
> 
Without the source codes and the commands used to create and run, it 
is impossible to offer constructive criticism of the results. However a
priori the above does not surprise me. I'll wager ldc2 or gdc will 
beat dmd for CPU-bound code, so as others have said for benchmarking 
use ldc2 or gdc with all optimization on (-O3). If you used gc for Go 
then switch to gccgo (again with -O3) and see a huge performance 
improvement on CPU-bound code.

Java beating C and C++ is fairly normal these days due to the tricks 
you can play with JIT over AOT optimization. Once Java has proper 
support for GPGPU, it will be hard for native code languages to get 
any new converts from JVM.

Put the source up and I and others will try things out.
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d-learn mailing list