Modern C++ Lamentations

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Dec 29 18:06:54 UTC 2018


On Sat, Dec 29, 2018 at 03:57:57PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Saturday, 29 December 2018 at 15:34:19 UTC, H. S. Teoh wrote:
> > Yeah no kidding, recently I rewrote a whole bunch of code to get
> > *rid* of dependency on std.regex because it was too slow, and
> > project compilation time improved from about 7+ seconds
> 
> Ditto. (Basically). Rewriting the uri parser in cgi.d brought its
> build time from about 3 seconds down to 0.6. Which still feels slow,
> especially next to my minigui.d, which can do 0.3 since it broke off
> from Phobos entirely! (It was 2.5 seconds before).

IME, Phobos isn't all bad. Some Phobos modules are pretty useful, esp.
std.algorithm and std.range, and despite std.algorithm being pretty huge
(its submodules are pretty huge even after I split up the original
std/algorithm.d -- which was so bad I couldn't run its unittests locally
anymore because it ran out of memory, on a machine with 4GB RAM) it
actually compiles very fast, proportional to how much you use it. The
bad apples are std.regex, std.format, and maybe a few others, that rely
a little too heavily on recursive templates and CTFE.


> > But we seriously need to improve on these two areas before we start
> > proclaiming how good D compilation times are, because that's no
> > longer true.
> 
> Amen. I have boxes that have infinite D build times because it is
> impossible to run the sloppy compiler!

Yeah, this is one reason I haven't dared propose using D at my day job.
I'd be laughed out of the CTO's office if dmd ran out of memory on a
trivial regex test. And my coworkers will hate me so much for making the
already RAM-heavy build system soak up even more memory. Memory may be
cheap these days, but it's still not free, and it's still a finite
resource.


T

-- 
Customer support: the art of getting your clients to pay for your own incompetence.


More information about the Digitalmars-d mailing list