-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Significant amount of time to compile an empty file #43300
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
For incremental compilation I was thinking about implementing a simple hash-table that can be memory-mapped. DefPathTable would be another candidate for that. |
@michaelwoerister Is that something you could give @alexcrichton a bit more info on and he could tackle? |
Each crate we are loading contains a I see now that having a mmapped version of that reverse lookup table would be kind of tricky, since the keys ( As a starting pointing, one could try to decode the |
Hm, looking at the code again, it seems like we actually don't need the reverse lookup map anymore When I switched the dep-graph to using stable I'll make a PR removing the table... |
I opened #43361 and would be interested in the impact this has here. |
In testing locally @michaelwoerister it looks like #43361 shaves about 20ms off an empty file compile time, thanks @michaelwoerister! After that PR the longest timings are:
|
…h, r=nikomatsakis Remove unused DefPathTable::retrace_path() `DefPathTable::retrace_path()` is not used anymore for a while now and removing it also removes the need to build the costly `DefPathTable::key_to_index` map for every upstream crate. cc rust-lang#43300 r? @eddyb
Compiling an empty crate takes a little under 20ms today. This is a little better than clang (v14, what I have on my system)
The majority of the difference seems to be explained by the number of pages faulted in (possibly indirectly as a proxy for memory used, etc.) - |
Compiling an empty file into an rlib takes about 200 milliseconds locally which is a pretty significant chunk of time! Various passes look like:
Notably:
I believe the expansion timings are all related to:
The text was updated successfully, but these errors were encountered: