-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Windows: slow rustc startup #8859
Copy link
Copy link
Closed
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-windowsOperating system: WindowsOperating system: Windows
Metadata
Metadata
Assignees
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-windowsOperating system: WindowsOperating system: Windows
Type
Fields
Give feedbackNo fields configured for issues without a type.
Okay, maybe Windows is slower, but not this slow.
Profiling shows that roughly 1.6 seconds of this time were spent in function "_pei386_runtime_relocator", which is invoked upon loading of rust runtime libraries. librustc accounts for more than 90% of this time, the rest is mostly in rustllvm.
Apparently this function comes from mingw runtime and performs "runtime pseudo-relocations". Note that it calls VirtualQuery once and VirtualProtect twice per relocated address, so no wonder it's slow!
This is the first time I'm coming across pseudo-relocations. Does anybody here know what exactly they are, and why does librustc have so many of them?