[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: A patch proposed in issue 20041 provides a backward compatible solution to this performance enhancement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: 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(), except the tracing function does receive line-number events. The 2.7 patch breaks test_hotshot because PyTrace_LINE events are not sent anymore when f_trace is NULL. The first patch (already applied to the default branch), breaks also existing applications that expect to receive line events when they don't care to implement the following semantics defined by sys.settrace: The trace function is invoked (with event set to 'call') whenever a new local scope is entered; it should return a reference to a local trace function to be used that scope, or None if the scope shouldn’t be traced. Those applications want to receive unconditionally line debug events. Attached is a patch that reverts the patch on the default branch. -- Added file: http://bugs.python.org/file28806/revert_f_trace_perfs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Jesús Cea Avión added the comment: 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?. -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Roundup Robot added the comment: New changeset cd87afe18ff8 by Benjamin Peterson in branch 'default': revert #16672 for incorrect semantics http://hg.python.org/cpython/rev/cd87afe18ff8 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: It is not possible to improve the performances of the trace function set with sys.settrace without breaking backward compatibility for PyEval_SetTrace or without introducing a new PyEval_xxx of some sort. Yes, I suggest to revert this patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: status should be close, I guess. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Benjamin Peterson benja...@python.org: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: Attached is a patch for the current head of 2.7. It would nice to have this patch on 2.7 too. With this patch, an implementation of pdb running on 2.7 with an extension module, runs at 1.2 times the speed of the interpreter when the trace function is active (see http://code.google.com/p/pdb-clone/wiki/Performances). The performance gain is 30%. -- Added file: http://bugs.python.org/file28803/f_trace_perfs-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Jesús Cea Avión j...@jcea.es: -- assignee: - benjamin.peterson nosy: +benjamin.peterson resolution: fixed - stage: committed/rejected - patch review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Jesús Cea Avión added the comment: Benjamin, ans the previous commiter, could you possibly check the 2.7 proposed patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Benjamin Peterson added the comment: This patch causes test_hotshot to fail. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Antoine Pitrou added the comment: I don't think performance patches should be committed to bugfix branches (especially 2.7 which is in slow maintenance mode). Recommend closing. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Benjamin Peterson added the comment: That, too. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: One may argue that this is not only a performances patch and that it fixes the wasting of cpu resources when tracing is on. Wasting cpu resources is a bug. Anyway, this is fine with me to close this minor issue on 2.7. The test_hotshot test is ok on my linux box and with the patch applied on 2.7 head. Just curious to know what the problem is. And thanks for applying the patch to 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Roundup Robot added the comment: New changeset 1fb26db7d719 by Benjamin Peterson in branch 'default': improve tracing performance when f_trace is NULL (closes #16672) http://hg.python.org/cpython/rev/1fb26db7d719 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +belopolsky, georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
New submission from Xavier de Gaye: When f_trace is NULL, only PyTrace_CALL tracing events trigger the invocation of the trace function (see trace_trampoline). maybe_call_line_trace() does quite some work though _PyCode_CheckLineNumber to find out if the instruction should be traced, and all this work is useless when f_trace is NULL. The patch checks for f_trace on all tracing events that are not PyTrace_CALL. The performance gain with the following test is about 30%. The first test is with python on the default branch, the second one with the patch applied. Note: a breakpoint is set at line 1 to ensure that tracing is enabled, without any breakpoint, pdb sets the trace function to None after a continue. $ ./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.22638593106 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) -- components: Interpreter Core files: f_trace_perfs.diff keywords: patch messages: 177390 nosy: xdegaye priority: normal severity: normal status: open title: improve tracing performances when f_trace is NULL type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file28297/f_trace_perfs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Xavier de Gaye xdeg...@gmail.com: Added file: http://bugs.python.org/file28298/foo.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Changes by Xavier de Gaye xdeg...@gmail.com: Added file: http://bugs.python.org/file28299/bar.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16672] improve tracing performances when f_trace is NULL
Xavier de Gaye added the comment: When f_trace is NULL, only PyTrace_CALL tracing events trigger the invocation of the trace function (see trace_trampoline). This may be confusing. I meant that when f_trace is NULL, PyTrace_LINE, PyTrace_RETURN and PyTrace_EXCEPTION are not traced. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com