Speeding up importing Phobos files

Jonathan M Davis newsgroup.d at jmdavisprog.com
Tue Jan 22 02:25:25 UTC 2019


On Monday, January 21, 2019 5:46:32 PM MST Arun Chandrasekaran via 
Digitalmars-d wrote:
> > being very convenient for the user to treat Phobos as a single
> > file rather than a blizzard. (phobos.lib could also be in the
> > same file!)
>
> We already have std.experimental.all for convenience.

If I understand correctly, that's an orthogonal issue. What Walter is
proposing wouldn't change how any code imported anything. Rather, it would
just change how the compiler reads the files. So, anyone wanting to import
all of Phobos at once would still need something like std.experimental.all,
but regardless of how much you were importing from Phobos, dmd would read in
all of Phobos at once, because it would be a single zip file. It would then
only actually compile what it needed to for the imports in your program, but
it would have read the entire zip file into memory so that it would only
have to open one file instead of searching for and opening each file
individually.

- Jonathan M Davis





More information about the Digitalmars-d mailing list