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

Use /O2 instead of /Ox option for MSVC #30

Closed
ghost opened this issue Feb 22, 2021 · 3 comments
Closed

Use /O2 instead of /Ox option for MSVC #30

ghost opened this issue Feb 22, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 22, 2021

In MSVC, /Ox optimization is used by default.

Compared with /Ox, /O2 has these two additional options:

  • /GF: eliminates duplicate strings
  • /Gy: does function level linking

A stackoverflow question, it has some doc links:
https://stackoverflow.com/questions/5063334/what-is-the-difference-between-the-ox-and-o2-compiler-options

I tested a CPython module pyzstd, adding /GF reduced the .pyd file size from 642 KB to 641 KB, further adding /Gy reduced to 466 KB (!). It seems no performance loss.

A CPython issue about this:
https://bugs.python.org/issue37794

@EvgenKo423
Copy link

Thanks for re-posting. I hope at least here this will finally be fixed...


Off-topic:

It's great that Python finally decided to ditch distutils, but it's a shame they just officially dropped this task on setuptools and don't seem like plan to include it in standard library as a replacement. Or make standard library managed by pip as well, so it could be updated on demand.
I don't quite get it: how would you install setuptools if there would be no more distutils?

@ghost
Copy link
Author

ghost commented Feb 26, 2021

@Kojoley , the poster of CPython issue37794.

@jaraco jaraco transferred this issue from pypa/setuptools Mar 7, 2021
@ghost
Copy link
Author

ghost commented Apr 24, 2021

Fixed in #33

@ghost ghost closed this as completed Apr 24, 2021
jaraco added a commit that referenced this issue Jul 1, 2023
* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <[email protected]>
jaraco added a commit that referenced this issue Jul 1, 2023
* Use `extend-ignore` in flake8 config

This option allows to add extra ignored rules to the default list
instead of replacing it.

The default exclusions are: E121, E123, E126, E226, E24, E704,
W503 and W504.

Fixes #28.

Refs:
* https://github.com/pypa/setuptools/pull/2486/files#r541943356
* https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-ignore
*
https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore

* Enable complexity limit. Fixes jaraco/skeleton#34.

* Replace pep517.build with build (#37)

* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <[email protected]>

* Use license_files instead of license_file in meta (#35)

Singular `license_file` is deprecated since wheel v0.32.0.

Refs:
* https://wheel.readthedocs.io/en/stable/news.html
* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

Co-authored-by: Jason R. Coombs <[email protected]>
This issue was closed.
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

No branches or pull requests

1 participant