Building C++ modules
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Aug 15 23:06:47 UTC 2019
On Thu, Aug 15, 2019 at 10:48:35PM +0000, Stefan Koch via Digitalmars-d wrote:
> On Thursday, 15 August 2019 at 22:37:16 UTC, H. S. Teoh wrote:
> > On Thu, Aug 15, 2019 at 08:09:33PM +0000, Exil via Digitalmars-d wrote:
> > [...]
> > (2) Using too many templates / CTFE. CTFE is known to be dog-slow.
> > NewCTFE is supposed to improve this, but at the rate things are
> > going, I'm not holding my breath for it.
> >
>
> Now, if you cloud hold your breath for about a year ....
Whoa, now *that's* good news I've been dying to hear! :-)
> Regarding phobos even worse than regex is std.uni and std.format which
> imports uni.
> And because of importing also std.conv and std.stdio.
Oh yeah, std.format is a bear. Sadly, I can't live without it (too
addicted to format-string based string output), but every second spent
waiting for std.format to compile (and it does increase compilation by a
significant number of seconds) is a second of anguish and teeth-gritting
("Why is std.format so dog-slow to compile?!?!").
> By removing all mentions of std.stdio.writeln and std.conv.to in my
> own code, I was a able to reduce my compile-times from 30s to 2s and
> reduce the memory usage from 26G to .6G.
[...]
I thought std.conv.to wasn't *that* bad? Well, I guess it depends on
what you use it for. The implementation *does* involve a ridiculous
number of template expansions. I can't help wondering if we could
refactor the ridiculous number of toImpl overloads into a single
function with static-if blocks to dispatch to the various different
cases.
(This would also improve the documentation, which last I checked still
suffers from sig constraint abuse, AKA exposing implementation details
in the sig constraint that are irrelevant to the user, where it really
should be a static-if + static-assert inside the implementation.)
T
--
"The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts." -- Bertrand Russell. "How come he didn't put 'I think' at the end of it?" -- Anonymous
More information about the Digitalmars-d
mailing list