-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add O2 and LTCG flag for MSVC Windows branch #2
Conversation
Hi @WesleyKhoiVo! Thanks for your contribution! I will check it out after I finish with the PR for I thought that |
I can't find any document or link say cmake add O2 automatically when we switch to Release, so I added it manually. Note: it just improve CPU usage, FPS still drop sometime, so we need more time to cleanup game engine |
I'm testing the PR and get the following warning after building: |
Update comment: |
And linker performance is just effect to compile time, not effect to runtime anyway 😄 |
Hi @vi3itor, can you recheck again? |
I checked, the warning is gone. |
Yeah, I think I will remove |
CMakeList current just optimize for Unix. Clang and GNU GCC have O3 flag for optimize performance code. MSVC doesn't have O3, so I use O2 flag for speed and LTCG for force compiler use inline function every time.
In my personal test, I saw in task manager, use O2 and LTCG help to improve estimate 2% ~ 5% CPU usage.
LTCG flag
O2 flag