www.digitalmars.com         C & C++   DMDScript  

D.gnu - GDCs emitted code is crazy fast

reply James Blachly <james.blachly gmail.com> writes:
I got around to finally compiling my project (processing high throughput 
sequencing data) and found GDC compiled code executed TWICE as fast as 
LDC compiled code, which itself was faster than DMD. I am truly surprised.

Can't test all my code yet as GDC 8.3.0 doesn't include support for 
assoc array require. I hope that there are plans for convenient binary 
installs (rather than through package managers which tend to be 
outdated, and cannot be installed on managed systems) as there are with 
DMD and LDC.

Kudos to the GDC team.
Aug 18 2019
next sibling parent reply Daniel Kozak <kozzi11 gmail.com> writes:
On Monday, 19 August 2019 at 03:47:04 UTC, James Blachly wrote:
 I got around to finally compiling my project (processing high 
 throughput sequencing data) and found GDC compiled code 
 executed TWICE as fast as LDC compiled code, which itself was 
 faster than DMD. I am truly surprised.

 Can't test all my code yet as GDC 8.3.0 doesn't include support 
 for assoc array require. I hope that there are plans for 
 convenient binary installs (rather than through package 
 managers which tend to be outdated, and cannot be installed on 
 managed systems) as there are with DMD and LDC.

 Kudos to the GDC team.
It is possible, to share your code, so any one else could try why is gdc faster than ldc? From what I can say, there is almost always a way to make ldc as fast as gdc (sometimes you need to pass some specific args to cimpiler or tweak a code a little bit)
Aug 19 2019
next sibling parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On Mon, 19 Aug 2019 at 10:00, Daniel Kozak via D.gnu
<d.gnu puremagic.com> wrote:
 On Monday, 19 August 2019 at 03:47:04 UTC, James Blachly wrote:
 I got around to finally compiling my project (processing high
 throughput sequencing data) and found GDC compiled code
 executed TWICE as fast as LDC compiled code, which itself was
 faster than DMD. I am truly surprised.

 Can't test all my code yet as GDC 8.3.0 doesn't include support
 for assoc array require. I hope that there are plans for
 convenient binary installs (rather than through package
 managers which tend to be outdated, and cannot be installed on
 managed systems) as there are with DMD and LDC.

 Kudos to the GDC team.
It is possible, to share your code, so any one else could try why is gdc faster than ldc? From what I can say, there is almost always a way to make ldc as fast as gdc (sometimes you need to pass some specific args to cimpiler or tweak a code a little bit)
Optimal code sometimes needs a bit of coercing. You shouldn't need to pass weird options though. -- Iain
Aug 19 2019
parent reply Daniel =?UTF-8?B?S296w6Fr?= <kozzi11 gmail.com> writes:
On Monday, 19 August 2019 at 10:54:09 UTC, Iain Buclaw wrote:
 Optimal code sometimes needs a bit of coercing.  You shouldn't 
 need to pass weird options though.
Yes I agree, generaly one is good with -O and -(f)release and sometimes with disable boundscheking, but with ldc there has been some issue with cross module inlining, so I need to use -enable-cross-module-inlining [1][2][3] to improve speed in past, but maybe it is not needed anymore. [1] https://github.com/ldc-developers/ldc/issues/2552 [2] https://github.com/ldc-developers/ldc/issues/2182 [3] https://github.com/ldc-developers/ldc/pull/2738
Aug 19 2019
parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On Mon, 19 Aug 2019 at 15:30, Daniel Kozák via D.gnu
<d.gnu puremagic.com> wrote:
 On Monday, 19 August 2019 at 10:54:09 UTC, Iain Buclaw wrote:
 Optimal code sometimes needs a bit of coercing.  You shouldn't
 need to pass weird options though.
Yes I agree, generaly one is good with -O and -(f)release and sometimes with disable boundscheking, but with ldc there has been some issue with cross module inlining, so I need to use -enable-cross-module-inlining [1][2][3] to improve speed in past, but maybe it is not needed anymore.
Surely LTO solves the cross-module inlining problem? -- Iain
Aug 19 2019
parent Daniel Kozak <kozzi11 gmail.com> writes:
On Monday, 19 August 2019 at 14:02:37 UTC, Iain Buclaw wrote:
 On Mon, 19 Aug 2019 at 15:30, Daniel Kozák via D.gnu 
 <d.gnu puremagic.com> wrote:
 On Monday, 19 August 2019 at 10:54:09 UTC, Iain Buclaw wrote:
 Optimal code sometimes needs a bit of coercing.  You 
 shouldn't need to pass weird options though.
Yes I agree, generaly one is good with -O and -(f)release and sometimes with disable boundscheking, but with ldc there has been some issue with cross module inlining, so I need to use -enable-cross-module-inlining [1][2][3] to improve speed in past, but maybe it is not needed anymore.
Surely LTO solves the cross-module inlining problem?
I guess it would, but I haven't try it wit LTO-enabled phobos, so it does not seems to work for me [1]. [1] https://github.com/ldc-developers/ldc/issues/2182#issuecomment-343154497
Aug 20 2019
prev sibling parent James Blachly <james.blachly gmail.com> writes:
On 8/19/19 3:59 AM, Daniel Kozak wrote:
 It is possible, to share your code, so any one else could try why is gdc 
 faster than ldc? From what I can say, there is almost always a way to 
 make ldc as fast as gdc (sometimes you need to pass some specific args 
 to cimpiler or tweak a code a little bit)
Upon further testing (replicates) it is looking perhaps only 50% faster. Still, very nice. Once we open up the repository I'll try to report back.
Aug 19 2019
prev sibling next sibling parent reply Daniel Kozak <kozzi11 gmail.com> writes:
On Monday, 19 August 2019 at 03:47:04 UTC, James Blachly wrote:
I hope that there are plans for
 convenient binary installs (rather than through package 
 managers which tend to be outdated, and cannot be installed on 
 managed systems) as there are with DMD and LDC.

 Kudos to the GDC team.
which OS/Distro, if you want I can try to make some binary for you
Aug 19 2019
parent reply James Blachly <james.blachly gmail.com> writes:
On 8/19/19 4:02 AM, Daniel Kozak wrote:
 On Monday, 19 August 2019 at 03:47:04 UTC, James Blachly wrote:
 I hope that there are plans for
 convenient binary installs (rather than through package managers which 
 tend to be outdated, and cannot be installed on managed systems) as 
 there are with DMD and LDC.

 Kudos to the GDC team.
which OS/Distro, if you want I can try to make some binary for you
That is a very generous offer, thank you. I will try to spin up a VM in which I can install a newer GDC. As a broader point, though, do you think it would help improve adoption of GDC (and perhaps the D ecosystem overall) if one could `tar xfvz gdc-9.tar.gz && export PATH gdc/bin` in the same way we do with DMD and LDC? I understand this has not been the traditional model with GCC, but then again the LDC team do not iterate only when LLVM updates major version either. Kind regards
Aug 19 2019
parent Daniel Kozak <kozzi11 gmail.com> writes:
On Tuesday, 20 August 2019 at 02:18:42 UTC, James Blachly wrote:
 As a broader point, though, do you think it would help improve 
 adoption of GDC (and perhaps the D ecosystem overall) if one 
 could `tar xfvz gdc-9.tar.gz && export PATH gdc/bin` in the 
 same way we do with DMD and LDC?
Yes, I do. I know many people who would prefere to just download some archive unpack it and use it.
Aug 20 2019
prev sibling parent Iain Buclaw <ibuclaw gdcproject.org> writes:
On Mon, 19 Aug 2019 at 05:50, James Blachly via D.gnu
<d.gnu puremagic.com> wrote:
 I got around to finally compiling my project (processing high throughput
 sequencing data) and found GDC compiled code executed TWICE as fast as
 LDC compiled code, which itself was faster than DMD. I am truly surprised.

 Can't test all my code yet as GDC 8.3.0 doesn't include support for
 assoc array require. I hope that there are plans for convenient binary
 installs (rather than through package managers which tend to be
 outdated, and cannot be installed on managed systems) as there are with
 DMD and LDC.

 Kudos to the GDC team.
The require template is in gdc-9. Future releases should hopefully follow closely to dmd, we'll wait to see if this can be done for gcc-10 as am currently blocked on upstream dmd breakages that are being slow to get turned around. The releases of gcc itself are typically in the first week of May, and dmd releases on the 1st every three months, one them being May, to give an idea of what version is anticipated for gcc-10 and future releases, the latest release will never be older than 12 months behind. -- Iain
Aug 19 2019