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

MSVC compiler optimisation hinting, 1% smaller pygame on windows #1816

Merged
merged 3 commits into from May 23, 2020

Conversation

MyreMylar
Copy link
Contributor

Related to this issue:
#1403

So far the code I've added to setup.py adds two flags to the extension modules compile process when the system is 'win32' and the compiler supports the two flags. These flags both serve to reduce the size of the generated c code reducing our overall .egg file size by just under 1%.

@lgtm-com
Copy link

lgtm-com bot commented May 19, 2020

This pull request introduces 1 alert when merging 4d14f5e into 16a8d3e - view on LGTM.com

new alerts:

  • 1 for Module is imported more than once

@MyreMylar
Copy link
Contributor Author

Also added a PG_FORCEINLINE macro that is the same as PG_INLINE on all compilers except MSC_VER where it means __forceinline. I haven't used it anywhere yet though as Microsoft indicate that using __forceinline may sometimes make performance worse so using it will have to be done on a case by case.

@MyreMylar MyreMylar marked this pull request as ready for review May 19, 2020 12:43
Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

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

👍 Nice.

@illume illume merged commit 71572be into pygame:master May 23, 2020
@illume illume changed the title MSVC compiler optimisation hinting MSVC compiler optimisation hinting, 1% smaller pygame on windows May 29, 2020
@MyreMylar MyreMylar deleted the windows-optimisation-flags branch June 5, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants