-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Subsequent builds are slower on Windows + MSVC due to linking #77968
Comments
For a reference, on my Windows 11 laptop (22H2 as well) with MS Visual Studio 2022 it doesn't behave like that:
Windows 11 (22H2, 22621.1702) I am pretty sure that this is the same behavior that I have experienced before, on VS 2019 and Windows 10, but there may have been other factors affecting the linking time and resetting it with subsequent builds. I didn't do a clean experiment like that (but I can try). |
I have the same issue as Calinou using VS 2019, as I documented here: #77170 (comment) Predator Helios 500 When using SCU:
When not using SCU:
So my results with SCU are consistent with Calinou's. Without SCU, the 3rd build (second incremental rebuild) is even slower than the second. I'd need to try again to confirm, and see if yet another incremental rebuild makes it even worse. |
I recently removed VS 2019 and installed VS 2022. Testing again to see if the bug is still reproducible. Seems to be for me. Not using SCU, building with
I don't have in depth knowledge of how MSVC incremental linking and debug symbols work, but here's my hypothesis. The My analysis might be a bit off, but anyway it shows that incremental linking with MSVC is just broken. Given that a "clean" link when I'll try that and report back. |
Not using SCU, building with
For each build the total linking time seems to be around 10 to 12s on that machine for a dev build. Definitely not worth dealing with the bogus incremental linking. The resulting |
Fixes godotengine#77968. (cherry picked from commit bc1aef8)
Fixes godotengine#77968. (cherry picked from commit bc1aef8)
Fixes godotengine#77968. (cherry picked from commit bc1aef8)
Godot version
4.1.dev 72b5932
System information
Windows 11 22H2 - MSVC 2022 - Intel Core i9-13900K, OS and Godot repository on a fast M.2 SSD
Issue description
Subsequent builds are slower on Windows + MSVC due to the linking step performing incremental linking, but it's counterproductive for Godot.
This is on MSVC 17.4.3 (version from early 2023):
Updating to MSVC 17.6.2 (latest version available as of June 2023) improves the situation somewhat, but it's still much slower until you remove
bin/
:This behavior does not occur on Linux with GCC + mold. Link times are consistent regardless of whether the
bin/
folder was previously erased. Removing all**/*.a
files also does not impact total build time.Steps to reproduce
Use
git clean -dfxi
to remove all build files before compiling (only the first time).scons dev_build=yes scu_build=dev
.scene/main/node.h
to add a line break at the beginning of the file.scene/main/node.h
again to add a line break at the beginning of the file.bin/
folder, modifyscene/main/node.h
yet another time then build again. Compare the build time.Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: