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

Enable the /LTCG switch where applicable. #810

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Enable the /LTCG switch where applicable. #810

merged 1 commit into from
Feb 9, 2021

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Feb 5, 2021

CMake does not by default enable link-time code generation (read: optimizations). This adds the instrumentation to opt-in to such a thing without manual user intervention. This can be turned off by setting -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF. While I am skeptical that LTCG will offer any significant performance benefit, it does seem like the produced plClient.exe is smaller (down from ~22,000 KB to ~16,000 KB).

Copy link
Member

@zrax zrax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That much of a size reduction is probably worth it alone, regardless of performance... However, did you verify this doesn't remove those "unreferenced" objects MSVC sometimes warns about?

@Hoikas
Copy link
Member Author

Hoikas commented Feb 9, 2021

I noticed today that there seems to be an observable benefit to using this in debug mode. I didn't bother measuring anything though because meh, debug performance.

did you verify this doesn't remove those "unreferenced" objects MSVC sometimes warns about?

Good question. Off the top of my head, the only ones I could think of are in the console commands. Those still seem to be working. Are there any others I should be looking for in particular?

@zrax
Copy link
Member

zrax commented Feb 9, 2021

If the ones you found in the console are working, it's probably safe to say it works...

@zrax zrax merged commit dc64629 into H-uru:master Feb 9, 2021
@Hoikas Hoikas deleted the ipo branch May 2, 2021 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants