Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Windows takes a very long time #2314

Open
EZabolotniy opened this issue Aug 9, 2023 · 2 comments
Open

Building on Windows takes a very long time #2314

EZabolotniy opened this issue Aug 9, 2023 · 2 comments
Labels

Comments

@EZabolotniy
Copy link

On Windows, when Ninja creates a Subprocess to compile a file, it redirects the Subprocess's std::out and std::err to read dependencies from it:

startup_info.hStdOutput = child_pipe;
startup_info.hStdError = child_pipe;

I am using a custom compiler that, after compiling a file, prints the dependencies to std::err. In my case, printing to std::err might take about 2-3 seconds.
I tried to exclude Ninja from the process of reading from std::err by redirecting the Subprocess's std:: err to nul:

startup_info.hStdError = nul;

With this change, writing to std::err only takes a few microseconds.

Is there a way to fix this issue and improve interprocess communication speed on Windows?

@jhasse
Copy link
Collaborator

jhasse commented Sep 4, 2023

How much data does the compiler print? 2-3 seconds sound like a lot. Is the time spent in capturing the output or actually reprinting it on the console (this is slow on Windows)?

@jhasse jhasse added the windows label Sep 4, 2023
@digit-google
Copy link
Contributor

It would help tremendously if you could provide a simple reproduction case, i.e. a fake compiler program that outputs fake dependencies, and a related Ninja build plan, that shows the problem clearly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants