July 12, 2022

How do i achieve fast compile speed (results above were on windows, on linux i get much faster results):

I maintain healthy project management:

  • Templates ONLY when necessary and when the cost is worth the time saved in the long term

    • this is why i try to lobby for builtin tagged union instead of std.sumtype
  • Dependencies, only dependency WITHOUT dependencies, and i keep them at the bare minimum!

  • Imports of std: i simply don't, and i copy/paste functions i need

  • I avoid dub packages, instead i prefer import/src path, and i chery pick what i need

July 12, 2022

On Tuesday, 12 July 2022 at 10:32:36 UTC, ryuukk_ wrote:

>

How do i achieve fast compile speed (results above were on windows, on linux i get much faster results):

I maintain healthy project management:

This

>
  • Imports of std: i simply don't, and i copy/paste functions i need

  • I avoid dub packages, instead i prefer import/src path, and i chery pick what i need

And this.

Can be argued to not be healthy project management.

Of course if you're alone it doesn't matter, but if it's a larger project that will have multiple maintainers then it will never work and will tarnish the project entirely.

July 12, 2022

On Monday, 11 July 2022 at 21:46:10 UTC, IGotD- wrote:

>

Just depreciate the the DMD backend, it's just not up to the task anymore.

Just deprecate LDC and GDC. They compile slowly and are unlikely to ever deliver fast compile times, due to their design.

>

Some people say they like it because it is fast, yes it is fast because it doesn't do much.

If it produces code that's fast enough, there is zero benefit to using a different compiler. If you use a development workflow that's heavy on compilation, stay away from LDC or GDC until you're done - and even then, you might not have any motivation to use either.

July 12, 2022

On Tuesday, 12 July 2022 at 12:47:26 UTC, bauss wrote:

>

Of course if you're alone it doesn't matter, but if it's a larger project that will have multiple maintainers then it will never work and will tarnish the project entirely.

That's true, i work solo on my project so it doesn't bother me

It definitely is something hard to balance

But one sure thing is that's something you have to monitor every so often, if you don't, then you end up with poor build speed that's harder to fix

I wonder if DMD/LDC/GDC have built in tools to profile and track performance

Rust have this: https://perf.rust-lang.org/

Maybe we need to do something similar

July 14, 2022

On Tuesday, 12 July 2022 at 13:23:36 UTC, ryuukk_ wrote:

>

I wonder if DMD/LDC/GDC have built in tools to profile and track performance

Linux has a decent system wide profiler: https://perf.wiki.kernel.org/index.php/Main_Page
And there are other useful tools, such as callgrind. To take advantage of all these tools, DMD/LDC/GDC only need to provide debugging symbols in the generated binaries, which they already do. Profiling applications to identify performance bottlenecks is very easy nowadays.

>

Rust have this: https://perf.rust-lang.org/

Maybe we need to do something similar

What is this website? Are they tracking performance differences between different versions of Rust or something? Like ensuring that the compile time does not regress without them noticing this immediately?

July 14, 2022

On Monday, 11 July 2022 at 18:15:16 UTC, Ivan Kazmenko wrote:

>

Hi.

I'm looking at the compiler output of DMD (-O -release), LDC (-O -release), and GDC (-O3) for a simple array operation:

void add1 (int [] a)
{
    foreach (i; 0..a.length)
        a[i] += 1;
}

Here are the outputs: https://godbolt.org/z/GcznbjEaf

From what I gather at the view linked above, DMD does not use XMM registers for speedup, and does not unroll the loop either. Switching between 32bit and 64bit doesn't help either. However, I recall in the past it was capable of at least some of these optimizations. So, how do I enable them for such a function?

Ivan Kazmenko.

No, not in DMD. DMD generates what looks like 32 bit code adapted to x86_64.
LDC may optimize this kind of loop with a tri-way branch depending on how many array elements remain. but it can both generate very good loop code(particularly when AVX-512 is available and the struct/data arrangement in memory is unfavorable for SIMD) and very questionable code.
You may be losing performance for obscure reasons that look like gnomes decided to steal your precious cpu cycles and when that happens there is no way to fix it other than manually going in with a disassembler/debugger, changing defect optimizations in hot code paths to something faster then save back to executable file.(yikes, i know.)

July 14, 2022

On Thursday, 14 July 2022 at 05:30:58 UTC, Siarhei Siamashka wrote:

>

On Tuesday, 12 July 2022 at 13:23:36 UTC, ryuukk_ wrote:

>

I wonder if DMD/LDC/GDC have built in tools to profile and track performance

Linux has a decent system wide profiler: https://perf.wiki.kernel.org/index.php/Main_Page
And there are other useful tools, such as callgrind. To take advantage of all these tools, DMD/LDC/GDC only need to provide debugging symbols in the generated binaries, which they already do. Profiling applications to identify performance bottlenecks is very easy nowadays.

I am not talking about linux, and i am not talking about 3rd party tools

I am talking about the developers of DMD/LDC/GDC, do they profile the compilers, do they provide ways to monitor/track performance? do they benchmark specific parts of the compilers?

I am not talking about the output of valgrind

Zig also has: https://ziglang.org/perf/ (very slow to load)

Having such thing is more useful than being able to plug valgrind god knows how into the compiler and try to decipher what does what and what results correspond to what internally, and what about a graph over time to catch regressions?

DMD is very fast at compiling code, so i guess Walter doing enough work to monitor all of that

LDC on the other hand.. they'd benefit a lot by having such thing in place

July 14, 2022

On Thursday, 14 July 2022 at 13:00:24 UTC, ryuukk_ wrote:

>

On Thursday, 14 July 2022 at 05:30:58 UTC, Siarhei Siamashka wrote:

>

On Tuesday, 12 July 2022 at 13:23:36 UTC, ryuukk_ wrote:

>

I wonder if DMD/LDC/GDC have built in tools to profile and track performance

Linux has a decent system wide profiler: https://perf.wiki.kernel.org/index.php/Main_Page
And there are other useful tools, such as callgrind. To take advantage of all these tools, DMD/LDC/GDC only need to provide debugging symbols in the generated binaries, which they already do. Profiling applications to identify performance bottlenecks is very easy nowadays.

I am not talking about linux, and i am not talking about 3rd party tools

I am talking about the developers of DMD/LDC/GDC, do they profile the compilers, do they provide ways to monitor/track performance? do they benchmark specific parts of the compilers?

I am not talking about the output of valgrind

Zig also has: https://ziglang.org/perf/ (very slow to load)

Having such thing is more useful than being able to plug valgrind god knows how into the compiler and try to decipher what does what and what results correspond to what internally, and what about a graph over time to catch regressions?

DMD is very fast at compiling code, so i guess Walter doing enough work to monitor all of that

LDC on the other hand.. they'd benefit a lot by having such thing in place

Running valgrind on the compiler is completely trivial. Builtin profilers are often terrible. LDC and GDC and dmd all have instrumenting profilers builtin, of varying quality. gprof in particular is somewhat infamous.

dmd isn't particularly fast, it does a lot of unnecessary work. LDC is slow because LLVM is slow.

We need a graph over time, yes.

1 2
Next ›   Last »