Compilation speed bechmark

Bottled Gin gin at bottle.com
Sat Mar 16 12:02:39 UTC 2019


There is this new programming language called vlang 
(http://vlang.io). Does not enthuse me because of its 'go' like 
syntax. Anyway, I came across a mention on hacker news 
https://news.ycombinator.com/item?id=19405036 where they boast of 
incredible compilation speed. D is mentioned in the comparison 
table and the DMD compiler is listed with a comment "segfault 
after 6 minutes".

The benchmark program is simple and silly. It goes like

import std.stdio;

void main() {
   int a;
   a = 1;
   writeln(a);
   a = 2;
   writeln(a);
   a = 3;
   writeln(a);
   // more such code lines till a = 400000
   // ....
}

I generated the code and tried compiling (with dmd-2.085.0) on my 
linux box. To my astonishment, it has been compiling for the last 
10 minutes without generating any object file.

Why does it take so long?



More information about the Digitalmars-d mailing list