Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-117578: Fix inlining regression in PyType_GetModuleByDef()#123100
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hm, it doesn't sound right to override profile-guided optimization, especially since |
neonene commentedAug 20, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It is mentioned onthe faster-cpython repo that thetelco test has slowed down a lot. According to MSVC, the module state access counts were: Tested with the
This patch would need to be applied if we wanted as much speed as the global state access on Windows, which has little effect alone (1%) for some reason. |
Windows PGO: |
neonene commentedAug 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Is it acceptable that @requires_cdecimalclassCArithmeticOperatorsTest(ArithmeticOperatorsTest,unittest.TestCase): ...@unittest.skipIf(nottest.support.PGO,'PGO training only')deftest_excecise_binop(self):Decimal=self.decimal.Decimald=Decimal('11.1')foriinrange(500000):1+d# at least 300000 times |
I'll try |
Closing in favor of proposing the |
Uh oh!
There was an error while loading.Please reload this page.
On
mainand3.13, there are cases where theget_module_by_deffunction intypeobject.cis not inlined in its wrapper functions:get_module_by_def()PyType_GetModuleByDef()/Ob2:called/Ob3:inlined_PyType_GetModuleByDef2()/Ob2:called/Ob3:inlinedNon-builtin modules can have extra function-call overheads, where the wrappers cannot be inlined.
This PR specifies
Py_ALWAYS_INLINEto the callee.cc@encukou