Speeding up importing Phobos files

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Jun 7 19:58:42 UTC 2019


On Fri, Jun 07, 2019 at 03:48:53PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote:
[...]
> TBH, I've always kinda wanted to just do away with the ability to have
> modules/packages that DON'T match the filesystem. I never saw any
> sensible use-cases for supporting such weird mismatches that couldn't
> already be accomplished via -I (not to be confused with the new -i) or
> version/static if.
> 
> HOWEVER, that said, you do bring up an interesting point I'd never
> thought of: If concating a bunch of modules/packages into one file
> would improve compile time, than that would certainly be a feature
> worth considering.

I honestly doubt it would improve compilation time that much. Reading
files from the filesystem is pretty fast, compared to the rest of the
stuff the compiler has to do afterwards.

If anything, it would *slow down* the process if you really only needed
to import one module but it was concatenated with a whole bunch of
others in a single file, thereby requiring the compiler to parse the
whole thing just to find it. There's also the problem that if multiple
-I's were given, and more than 1 of those paths contain concatenated
modules, then the compiler would potentially have to parse *everything*
in *every import path* just to be sure it will find the one import you
asked for.

I don't know, it just seems like there are too many disadvantages to
justify doing this.


T

-- 
Philosophy: how to make a career out of daydreaming.


More information about the Digitalmars-d mailing list