Speeding up importing Phobos files

Gregor Mückl gregormueckl at gmx.de
Fri Jun 7 15:46:03 UTC 2019


On Friday, 7 June 2019 at 15:34:22 UTC, Mike Franklin wrote:
> What I'm proposing is that a library's organization can be one 
> file per module while it is being developed, but once it is 
> published for consumption by others all packages/modules are 
> concatenated into one file so it's faster for users to import.  
> Or you could even concatenate some packages/modules, but not 
> others depending on how users typically interact with the 
> library.
>
> There may be use cases (like mine with the memory-mapped IO 
> registers) where users may want to actually develop with more 
> than one module per file.  Or when one wants to share 
> multi-package/module cut-and-pastable code examples. But those 
> are special cases.
>
> What's nice is that it changes nothing for users today.  It 
> just removes an arbitrary limitation to help improve import 
> speed while enabling some more flexibility for those who may it.
>
> Mike

How would compilation even work with multiple modules per file? 
Wouldn't the compiler  have to parse all .d files in the whole 
search path then? That would be the opposite of faster compile 
times.


More information about the Digitalmars-d mailing list