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
improve tracing performances when f_trace is NULL #60876
Comments
When f_trace is NULL, only PyTrace_CALL tracing events trigger the invocation of The performance gain with the following test is about 30%. The first test is $ ./python -m pdb /tmp/foo.py
> /tmp/foo.py(1)<module>()
-> import timeit
(Pdb) break 1
Breakpoint 1 at /tmp/foo.py:1
(Pdb) continue
9.226385930000106
The program finished and will be restarted
> /tmp/foo.py(1)<module>()
-> import timeit
(Pdb) q
[62276 refs]
$ ./python -m pdb /tmp/foo.py
> /tmp/foo.py(1)<module>()
-> import timeit
(Pdb) break 1
Breakpoint 1 at /tmp/foo.py:1
(Pdb) continue
7.199809867001022
The program finished and will be restarted
> /tmp/foo.py(1)<module>()
-> import timeit
(Pdb) |
This may be confusing. I meant that when f_trace is NULL, PyTrace_LINE, |
New changeset 1fb26db7d719 by Benjamin Peterson in branch 'default': |
Attached is a patch for the current head of 2.7. With this patch, an implementation of pdb running on 2.7 with an |
Benjamin, ans the previous commiter, could you possibly check the 2.7 proposed patch? |
This patch causes test_hotshot to fail. |
I don't think performance patches should be committed to bugfix branches (especially 2.7 which is in slow maintenance mode). Recommend closing. |
That, too. |
One may argue that this is not only a performances patch and that it The test_hotshot test is ok on my linux box and with the patch applied And thanks for applying the patch to 3.4. |
The patch applied to the default branch should be reverted. The 2.7 _hotshot extension module follows the specifications of PyEval_SetTrace: """Set the tracing function to func. This is similar to PyEval_SetProfile(), The 2.7 patch breaks test_hotshot because PyTrace_LINE events are not sent The first patch (already applied to the default branch), breaks also existing """The trace function is invoked (with event set to 'call') whenever a new Those applications want to receive unconditionally line debug events. Attached is a patch that reverts the patch on the default branch. |
So, Xavier, are you saying that you are reverting the patch?. Could be possible to provide a "good" patch, with a correct test of the situation you describe? Or are you suggesting just revert this and close this bugentry for good?. |
New changeset cd87afe18ff8 by Benjamin Peterson in branch 'default': |
It is not possible to improve the performances of the trace function set with Yes, I suggest to revert this patch. |
status should be close, I guess. |
A patch proposed in bpo-20041 provides a backward compatible solution to this performance enhancement. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: