This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve performance of sys.settracing based tools.
Type: performance Stage: patch review
Components: Interpreter Core Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, brandtbucher, nedbat, pablogsal
Priority: normal Keywords: patch

Created on 2021-11-29 11:37 by Mark.Shannon, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 30364 merged Mark.Shannon, 2022-01-03 18:00
PR 31244 merged brandtbucher, 2022-02-10 04:27
PR 31908 merged Mark.Shannon, 2022-03-15 15:37
Messages (4)
msg407263 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-11-29 11:37
In our quest for performance, the performance of sys.settracing based tools has probably gotten worse.

1. How do we measure this?
2. How do fix this?

We will initially use coverage.py as proxy for all sys.settracing based tools when measuring  performance.

The fix is probably to use quickening to insert a minimum set of instrumentation instructions required for tracing/profiling.
The existence of `f_trace_opcode` is a bit of a problem however, as we will have to instrument *every* instruction.


Ideally, sys.settracing based tools should be faster on 3.11 than 3.10, but at the least we should provide a simple alternative to sys.settracing that is faster.
msg409842 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-06 13:09
New changeset e028ae99ecee671c0e8a3eabb829b5b2acfc4441 by Mark Shannon in branch 'main':
bpo-45923: Handle call events in bytecode (GH-30364)
https://github.com/python/cpython/commit/e028ae99ecee671c0e8a3eabb829b5b2acfc4441
msg413017 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-02-10 17:50
New changeset d7a5aca982def155a9255893cefcc1493c127c9c by Brandt Bucher in branch 'main':
bpo-45923: Add `RESUME_QUICK` (GH-31244)
https://github.com/python/cpython/commit/d7a5aca982def155a9255893cefcc1493c127c9c
msg415267 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-03-15 17:06
New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in branch 'main':
bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)
https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 90081
2022-03-15 17:06:49Mark.Shannonsetmessages: + msg415267
2022-03-15 15:37:28Mark.Shannonsetpull_requests: + pull_request30001
2022-02-10 17:50:23Mark.Shannonsetmessages: + msg413017
2022-02-10 04:27:12brandtbuchersetnosy: + brandtbucher
pull_requests: + pull_request29413
2022-01-06 13:09:32Mark.Shannonsetmessages: + msg409842
2022-01-03 18:00:04Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28578
2021-11-29 11:37:57Mark.Shannoncreate