www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Interesting, =?UTF-8?Q?=E2=80=A6?=

reply Russel Winder via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
For fun (!) I used my new ldc2 build on Fedora 20 to run my "π by
quadrature" examples. On my 7 year old 8 core workstation, the various C
++ versions tend to take about 1.1s using all 8 cores (as do C, Java,
Scala, etc.). Indeed generally so do all the D codes using LDC or GDC –
DMD takes generally twice as long.

Now something potentially remarkable: using ldc the std.parallelism.map
version of the code takes 0.6s. dmd takes 2.6s, I can't test gdc on
Fedora as Fedora do not package it and I haven't built it.

There could be many reasons for this result, but it appears at present a
genuine "D runs 1.8 times faster than C++".

Clearly this needs std.benchmark to be rolled out, along with something
equivalent for C++ (but I am not sure what just at present). More news
as it happens.
 
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Jun 06 2014
next sibling parent reply "Kai Nacke" <kai redstar.de> writes:
Hi Russel!

On Friday, 6 June 2014 at 16:04:44 UTC, Russel Winder via 
digitalmars-d-ldc wrote:
 There could be many reasons for this result, but it appears at 
 present a
 genuine "D runs 1.8 times faster than C++".
Which branch and which LLVM version did you use?
 Clearly this needs std.benchmark to be rolled out, along with 
 something
 equivalent for C++ (but I am not sure what just at present). 
 More news
 as it happens.
 
Yes, this has to be investigated. A "magical" increase in performance might also be a problem with measurement or a compiler bug. But hopefully not! :-) Regards, Kai
Jun 06 2014
parent Russel Winder via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
On Fri, 2014-06-06 at 16:11 +0000, Kai Nacke via digitalmars-d-ldc
wrote:
[…]
 Which branch and which LLVM version did you use?
I am compiling LDC merge-2.065 HEAD, using GCC 4.8.2 with LLVM 3.4 on Fedora 20. I will do something similar on Debian Sid, but there I try to use GCC 4.9 since I invariably try to compile my own stuff with -std=C++1y. […]
 Yes, this has to be investigated. A "magical" increase in 
 performance might also be a problem with measurement or a 
 compiler bug. But hopefully not! :-)
First thought has to be bad user code, but in this case I think not, but it could still be a factor. I am going to have to create new versions of the code to be working with benchmark frameworks rather than just the "one off timing" stuff I currently have. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 06 2014
prev sibling parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
 Now something potentially remarkable: using ldc the std.parallelism.map
 version of the code takes 0.6s. dmd takes 2.6s, I can't test gdc on
 Fedora as Fedora do not package it and I haven't built it.
Well, I have good news for you - I am nearly done with GDC RPM SPEC (installs GDC in /opt/gdc directory). The moment it is ready for testing by D community I will inform people on the NG. (I also have very unstable 4.8 SPEC which replaces system GCC with one that has D enabled...) -- http://dejan.lekic.org
Jun 09 2014
parent Russel Winder via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
On Mon, 2014-06-09 at 22:32 +0100, Dejan Lekic via digitalmars-d-ldc
wrote:
[…]
 Well, I have good news for you - I am nearly done with GDC RPM SPEC 
 (installs GDC in /opt/gdc directory). The moment it is ready for testing by 
 D community I will inform people on the NG.
 
 (I also have very unstable 4.8 SPEC which replaces system GCC with one that 
 has D enabled...)
Is /opt/gdc the right place to install to: given this is an RPM can't it just use the standard places. In particular gdc really needs to be in /usr/bin. Is the intention to get this RPM into RPMFusion? -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jun 10 2014