www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - LDC 1.25.0

reply kinke <noone nowhere.com> writes:
Glad to announce LDC 1.25 - some highlights:

- Based on D 2.095.1.
- LLVM for prebuilt packages bumped to v11.0.1; support added for 
LLVM 11.1 and upcoming 12.0.
- Profile/trace LDC invocations via --ftime-trace.
- New Windows installer and native 'Apple silicon' package.
- New experimental template emission scheme for 
-linkonce-templates. This option can significantly accelerate 
compilation times for optimized builds (e.g., 56% faster on my 
box when compiling the optimized Phobos unittests).

Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.25.0

Thanks to all contributors & sponsors!
Feb 21
next sibling parent reply Dennis <dkorpel gmail.com> writes:
Great stuff, thanks!

On Sunday, 21 February 2021 at 18:26:38 UTC, kinke wrote:
 - Profile/trace LDC invocations via --ftime-trace.
Is there more info on this? I tried it on a simple file, it generates a large json file. Can this be inspected to reduce compile times? The changelog and pull request do not reveal much info on how to use it for the uninformed.
Feb 21
parent reply kinke <noone nowhere.com> writes:
On Sunday, 21 February 2021 at 21:58:48 UTC, Dennis wrote:
 On Sunday, 21 February 2021 at 18:26:38 UTC, kinke wrote:
 - Profile/trace LDC invocations via --ftime-trace.
Is there more info on this? I tried it on a simple file, it generates a large json file. Can this be inspected to reduce compile times? The changelog and pull request do not reveal much info on how to use it for the uninformed.
See Johan's comment here: https://forum.dlang.org/post/usyrbgwzzwxnzzhqergx forum.dlang.org
Feb 21
parent reply Johan Engelen <j j.nl> writes:
On Monday, 22 February 2021 at 07:20:16 UTC, kinke wrote:
 On Sunday, 21 February 2021 at 21:58:48 UTC, Dennis wrote:
 On Sunday, 21 February 2021 at 18:26:38 UTC, kinke wrote:
 - Profile/trace LDC invocations via --ftime-trace.
Is there more info on this? I tried it on a simple file, it generates a large json file. Can this be inspected to reduce compile times? The changelog and pull request do not reveal much info on how to use it for the uninformed.
See Johan's comment here: https://forum.dlang.org/post/usyrbgwzzwxnzzhqergx forum.dlang.org
Thanks kinke. This article explains the basics: https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature I'm aware there is very little documentation about this... I lack the time to write up more details and promote it better. Now that it's released, I hope promotion can be picked up by LDC's users. Here is an example of how it can help: https://github.com/dlang/phobos/pull/7676#issuecomment-715373535 There is definitely room for improvement, but it requires user feedback and consideration of their different use cases. -Johan
Feb 22
parent reply Dennis <dkorpel gmail.com> writes:
On Monday, 22 February 2021 at 11:57:46 UTC, Johan Engelen wrote:
 This article explains the basics: 
 https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature
Thank you! I opened the trace of my project in chrome://tracing and found that the majority of semantic analysis was spent on instantiations of `std.conv: text`. I replaced them and compilation time went down from 2.1 to 1.6 seconds, which I think is a big win!
 There is definitely room for improvement, but it requires user 
 feedback and consideration of their different use cases.
I'm already happy with what is there, but so far the most annoying part is that chrome's viewer is terribly slow and unresponsive. It can easily take a minute to load a trace, after which it runs at 1 frame per second, so I'm looking for an alternative. The article mentions Speedscope, but my first impression isn't that great: it's still slow, and the interface is not self-explanatory unlike Chrome's. In the PR you mentioned tracy*, but I'm still looking at how to compile it for Linux since the release only seems to include Windows binaries. I guess I'll try it out on Windows first. *https://github.com/ldc-developers/ldc/pull/3624#issuecomment-735446453
Feb 25
parent reply Mathias LANG <geod24 gmail.com> writes:
On Thursday, 25 February 2021 at 19:57:04 UTC, Dennis wrote:
 In the PR you mentioned tracy*, but I'm still looking at how to 
 compile it for Linux since the release only seems to include 
 Windows binaries. I guess I'll try it out on Windows first.

 *https://github.com/ldc-developers/ldc/pull/3624#issuecomment-735446453
If it's the regular client, then just cd to https://github.com/wolfpld/tracy/tree/master/profiler/build/unix and run `make`. We use it on Linux without problem, but the profiler crashes on Mac OSX ATM.
Feb 25
parent Dennis <dkorpel gmail.com> writes:
On Friday, 26 February 2021 at 01:10:48 UTC, Mathias LANG wrote:
 If it's the regular client, then just cd to 
 https://github.com/wolfpld/tracy/tree/master/profiler/build/unix and run
`make`. We use it on Linux without problem, but the profiler crashes on Mac OSX
ATM.
I had to `sudo apt install libcapstone-dev`, but after that it worked! So for others, my current Debian-linux setup looks like this: ``` git clone https://github.com/wolfpld/tracy cd tracy/import-chrome/build/unix/ make anywhere sudo cp import-chrome-release /usr/bin/import-chrome cd ../../../ cd profiler/build/unix/ make sudo cp Tracy-release /usr/bin/tracy ``` Now add these settings to dub.sdl (either temporarily for all builds, or inside a specific configuration): ``` dflags "--ftime-trace" platform="ldc" dflags "--ftime-trace-file=./my-trace.json" platform="ldc" postBuildCommands "import-chrome ./my-trace.json ./my-trace.tracy" platform="ldc" ``` Then build and open the trace: ``` dub build --compiler=ldc2 tracy my-trace.tracy ``` And enjoy 60 fps!
Feb 26
prev sibling next sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/21/21 1:26 PM, kinke wrote:
 Glad to announce LDC 1.25 - some highlights:
 
 - Based on D 2.095.1.
 - LLVM for prebuilt packages bumped to v11.0.1; support added for LLVM 
 11.1 and upcoming 12.0.
 - Profile/trace LDC invocations via --ftime-trace.
 - New Windows installer and native 'Apple silicon' package.
 - New experimental template emission scheme for -linkonce-templates. 
 This option can significantly accelerate compilation times for optimized 
 builds (e.g., 56% faster on my box when compiling the optimized Phobos 
 unittests).
This is cool! Can you describe what it means? The option name isn't telling me anything obvious.
 
 Full release log and downloads: 
 https://github.com/ldc-developers/ldc/releases/tag/v1.25.0
 
 Thanks to all contributors & sponsors!
That's a first -- I haven't seen a 2.095.1 announcement yet (just the beta) -Steve
Feb 21
parent kinke <noone nowhere.com> writes:
On Monday, 22 February 2021 at 02:32:22 UTC, Steven Schveighoffer 
wrote:
 This is cool! Can you describe what it means? The option name 
 isn't telling me anything obvious.
Please see the changelog for more details.
 That's a first -- I haven't seen a 2.095.1 announcement yet 
 (just the beta)
Hmm, maybe Martin forgot the announcement or hasn't gotten to it yet; it's available on dlang.org.
Feb 21
prev sibling next sibling parent Mathias LANG <geod24 gmail.com> writes:
On Sunday, 21 February 2021 at 18:26:38 UTC, kinke wrote:
 Glad to announce LDC 1.25 - some highlights:

 - Based on D 2.095.1.
 - LLVM for prebuilt packages bumped to v11.0.1; support added 
 for LLVM 11.1 and upcoming 12.0.
 - Profile/trace LDC invocations via --ftime-trace.
 - New Windows installer and native 'Apple silicon' package.
 - New experimental template emission scheme for 
 -linkonce-templates. This option can significantly accelerate 
 compilation times for optimized builds (e.g., 56% faster on my 
 box when compiling the optimized Phobos unittests).

 Full release log and downloads: 
 https://github.com/ldc-developers/ldc/releases/tag/v1.25.0

 Thanks to all contributors & sponsors!
Amazing! We were really looking forward to this release, as it makes both Alpine Linux and `-preview=in` finally usable for us, and will allow us to build some useful tools on top of the GC. Many thanks for your continuous efforts in maintaining the project!
Feb 22
prev sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sun, Feb 21, 2021 at 06:26:38PM +0000, kinke via Digitalmars-d-announce
wrote:
 Glad to announce LDC 1.25 - some highlights:
 
 - Based on D 2.095.1.
Awesome!! Thanks to everyone in the LDC team who made this release possible. [...]
 - New experimental template emission scheme for -linkonce-templates.
 This option can significantly accelerate compilation times for
 optimized builds (e.g., 56% faster on my box when compiling the
 optimized Phobos unittests).
[...] Tested this on one of my projects yesterday. For -O3, it reduced compile time by about ~26%. For -O, it reduced compile time by about 24%. Not as much as I'd hoped, but still pretty big reductions. For non-optimized builds, it reduced compile times by only 1-2% (pretty insignificant). T -- The easy way is the wrong way, and the hard way is the stupid way. Pick one.
Feb 23
parent reply kinke <noone nowhere.com> writes:
On Tuesday, 23 February 2021 at 18:19:09 UTC, H. S. Teoh wrote:
 Tested this on one of my projects yesterday. For -O3, it 
 reduced compile time by about ~26%.  For -O, it reduced compile 
 time by about 24%.  Not as much as I'd hoped, but still pretty 
 big reductions.
Thx for some numbers. [Note that -O == -O3 == -O4 == -O5, they are all the same (at least for now), contrary to what you might read somewhere.] A reduction by 25%, i.e., a 1.33x speed-up, for code that is guaranteed to be at least as fast as before (higher cross-module inlining potential) isn't too bad, aye? :)
 For non-optimized builds, it reduced compile times by only 1-2% 
 (pretty insignificant).
I find it rather interesting that it isn't any slower. Compiling debug Phobos all-at-once took 67% longer on my box (and increased the static lib size by 76%). Without -O, I've only seen some improvements with `-unittest`. Some more numbers on my box: https://github.com/ldc-developers/ldc/pull/3600#issuecomment-729116599 https://github.com/ldc-developers/ldc/pull/3422#issuecomment-661386233
Feb 23
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Feb 23, 2021 at 07:32:13PM +0000, kinke via Digitalmars-d-announce
wrote:
 On Tuesday, 23 February 2021 at 18:19:09 UTC, H. S. Teoh wrote:
 Tested this on one of my projects yesterday. For -O3, it reduced
 compile time by about ~26%.  For -O, it reduced compile time by
 about 24%.  Not as much as I'd hoped, but still pretty big
 reductions.
Thx for some numbers. [Note that -O == -O3 == -O4 == -O5, they are all the same (at least for now), contrary to what you might read somewhere.] A reduction by 25%, i.e., a 1.33x speed-up, for code that is guaranteed to be at least as fast as before (higher cross-module inlining potential) isn't too bad, aye? :)
Yeah actually it's pretty good. It's only that my expectations were a bit high when you reported 50+% reductions in compile times. :-)
 For non-optimized builds, it reduced compile times by only 1-2%
 (pretty insignificant).
I find it rather interesting that it isn't any slower. Compiling debug Phobos all-at-once took 67% longer on my box (and increased the static lib size by 76%). Without -O, I've only seen some improvements with `-unittest`.
[...] Interesting indeed. I just did a quick test with -unittest, and got these numbers: -unittest: 15.9 sec -unittest -linkonce-templates: 22.3 sec -unittest -O: 54.4 sec -unittest -O -linkonce-templates: 40.7 sec Apparently with -unittest it *does* run slower without -O. But with -O, it does run faster. T -- It won't be covered in the book. The source code has to be useful for something, after all. -- Larry Wall
Feb 23