How to break module into multiple file.

Adam Ruppe destructionator at gmail.com
Thu May 12 11:25:19 PDT 2011


> For small projects this is OK, but for large - not quite, IMHO.

I don't know about that. I always compile everything at once
now - in my experience, it's negligibly slower than linking alone.

druntime: compiled all at once takes ~1 second on my box. 65k lines of (light) code.

phobos: compiled all at once takes ~1 second. 150k loc.

my web app for work: 3 seconds, all at once. 50k loc, does some crazy stuff.


Maybe million line programs will be unacceptably slow, but I don't
know, I'd have to actually see it being a problem in practice
before I get worked up about it. tbh I wouldn't be surprised if
the incremental build was actually slower than the all at once in
a lot of situations.

(Though, naming the packages and modules to match the filesystem is
a small cost anyway - it makes it easier to find the files so usually
the best choice anyway.)


More information about the Digitalmars-d-learn mailing list