Is dmd fast?

qznc via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 5 14:14:00 PDT 2016


On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote:
> Walter and we as a community often claim that dmd is fast as in 
> "compiles quickly". Go also claims this. Rust does not. They 
> even state that compilation speed is one of the big tasks they 
> are working on.

I found a comparison for D and Rust, which uses a bigger program: 
Compile the respective package manager dub/cargo. They are (very 
roughly) programs of the same complexity.

Short: DMD 21sec vs Rust 56sec

Longer:
➤ time dub build --force
Performing "debug" build using dmd for x86_64.
dub 1.0.0+commit.8.gcdfaf60: building configuration 
"application"...
source/dub/internal/sdlang/lexer.d(16,8): Deprecation: module 
std.stream is deprecated - It will be removed from Phobos in 
October 2016. If you still need it, go to 
https://github.com/DigitalMars/undeaD
Linking...
6.76user 0.96system 0:21.83elapsed 35%CPU (0avgtext+0avgdata 
1106000maxresident)k
141800inputs+84280outputs (225major+325767minor)pagefaults 0swaps
➤ time cargo build
    Compiling cargo v0.12.0 (file:///home/qznc/dev/rust/cargo)
54.02user 1.56system 0:56.00elapsed 99%CPU (0avgtext+0avgdata 
629400maxresident)k
1144inputs+297400outputs (6major+459076minor)pagefaults 0swaps

Even more drastic is the user time: DMD 7sec vs Rust 54sec. I'm 
not sure where DMD spends the rest of the time? Page faults?


More information about the Digitalmars-d mailing list