www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Java Spring vs. D Vibe.d basic web performance

reply Vijay Nayar <madric gmail.com> writes:
I created a small blog post about compilation speeds, binary 
sizes, and request processing performance of Java Spring, D 
Vibe.d compiled with debug/release mode and DMD/LDC compilers.

https://www.funnel-labs.io/2022/06/17/language-choice-and-performance-java-and-d/

The interesting thing is that a web service compiled with both 
DMD and LDC in debug mode has very low throughput, much worse 
than Java, however, D benefits from faster compilation times.

When compiling in release mode, both DMD and LDC have about 80% 
to 100% higher performance than Java. The DMD and LDC versions 
also run in significantly less RAM than Java as well (about a 95% 
reduction in both resident and virtual memory).

A few other interesting observations are that a web-server 
compiled with LDC takes up about 10x more virtual RAM compared to 
the DMD version.

The final fascinating observation is this: despite the longer 
initial compilation times when compiling in release mode, both 
DMD and LDC have faster iterative compilations in release mode 
than even debug mode. My suspicion is that the smaller file sizes 
that result from compiling in release mode result in overall 
faster incremental compilation. It makes me wonder if larger 
companies could benefit strongly from even doing release mode 
compilation, but keeping compiled artifacts in a shared server, 
following a model similar to what [Bazel](https://bazel.build/) 
can offer.
Jun 17 2022
parent James Blachly <james.blachly gmail.com> writes:
On Friday, 17 June 2022 at 21:37:52 UTC, Vijay Nayar wrote:
...
 When compiling in release mode, both DMD and LDC have about 80% 
 to 100% higher performance than Java. The DMD and LDC versions 
 also run in significantly less RAM than Java as well (about a 
 95% reduction in both resident and virtual memory).
Great data Vijay, thanks! Benchmarks are always nice to have.
 The final fascinating observation is this: despite the longer 
 initial compilation times when compiling in release mode, both 
 DMD and LDC have faster iterative compilations in release mode 
 than even debug mode. My suspicion is that the smaller file 
 sizes that result from compiling in release mode result in 
 overall faster incremental compilation. It makes me wonder if 
 larger companies could benefit strongly from even doing release 
 mode compilation, but keeping compiled artifacts in a shared 
 server, following a model similar to what 
 [Bazel](https://bazel.build/) can offer.
Certainly could work, but we'd need far better tooling. Too, most compilations are sure to be in debug mode, and already fast. Release compilations are relatively rare-er and if it takes longer, no big deal? I guess I'm not working on projects big enough that it matters -- our release builds still complete in under 60 sec.
Jun 22 2022