[issue36616] Optimize thread state handling in function call code

2019-04-24 Thread STINNER Victor
STINNER Victor added the comment: See also my PR 12934 which includes a similar change but for correctness, not for optimization. -- ___ Python tracker ___ __

[issue36616] Optimize thread state handling in function call code

2019-04-16 Thread STINNER Victor
STINNER Victor added the comment: Jeroen Demeyer closed his PR 12839, so I close the issue as well. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: > The gain is small, but it's there. Do you mean a performance speedup? If yes, can you please run a micro-benchmark? -- ___ Python tracker

[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: The gain is small, but it's there. I made some further changes: - replacing code of the form sp = stack_pointer; call_function(..., &sp, ...) stack_pointer = sp; by call_function(..., &stack_pointer, ...) - fold the inline function do_ca

[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +12764 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: I wanted to do that, but I never measured the overhead of PyThreadState_GET() calls. Subtle detail: using _PyThreadState_GET() ("_Py") prefix rather than PyThreadState_GET() ensures that you get the optimized macro ;-) -- nosy: +vstinner ___

[issue36616] Optimize thread state handling in function call code

2019-04-15 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed, this is a good idea. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue36616] Optimize thread state handling in function call code

2019-04-13 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Mark, Petr, do you agree? I like the way how the reference implementation of PEP 590 improves the handling of profiling. However, that change really has little to do with PEP 590, it's something that we can do independently. -- _

[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue36616] Optimize thread state handling in function call code

2019-04-12 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : The bytecode interpreter uses an inline function call_function() to handle most function calls. To check for profiling, call_function() needs to call to PyThreadState_GET(). In the reference implementation of PEP 590, I saw that we can remove these PyThre