Why is D Slow?

Iain Buclaw ibuclaw at gdcproject.org
Wed Jul 26 08:56:32 UTC 2023


On Wednesday, 26 July 2023 at 07:44:35 UTC, Dlang Lover wrote:
> I've been reviewing most Benchmark tests lately. However, 
> system programming languages ​​such as Rust and C++ promise 
> high speed in almost every field. But I can't see that for D 
> language. For example, does it make sense for a Web Framework 
> to have such a speed issue between Rust and D? Why is there 
> such a speed difference?
>
> https://web-frameworks-benchmark.netlify.app/compare?f=vibed,axum
>

Shouldn't the question instead be: Why is the Web framework slow?


> Again, when I examine a few tests outside of the Web domain, 
> for example, in the Github repository below, D language comes 
> after C++ and Rust most of the time, but here too, DMD is slow 
> next to LDC and GDC.
>
> https://github.com/kostya/benchmarks
>
> What's behind the speed problem of the D language? What can be 
> done for this? Although I do not know much about compiler and 
> language development, if there is a solution to such problems? 
> I want to support as much as I can.

Without looking at what the tests are (or their validity to be 
called benchmarks). At least for C/gcc, C++/g++, D/gdc, and other 
frontend languages of GCC there is no strict reason why all 
couldn't be in joint position. Though each might look subtly 
different WRT abstractions, it is possible to get them all to 
generate the same AST which optimizes down to the same assembly.

Saying that, there's not a lot more that can be said about 
[insert random benchmark] that hasn't already been hashed and 
rehashed time and again here.


More information about the Digitalmars-d mailing list