Skip to content

Windows: slow rustc startup #8859

Closed
Closed
@vadimcn

Description

@vadimcn
C:\Rust\build>timeit "i686-pc-mingw32\stage2\bin\rustc.exe -v"
i686-pc-mingw32\stage2\bin\rustc.exe 0.8-pre (6c548ce 2013-08-27 23:29:33 -0700)
host: i686-pc-mingw32

Elapsed time = 1.701 seconds

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-slowIssue: Problems and improvements with respect to performance of generated code.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions