Python: tprof 1.3.0: now with less overhead 0 ▲ Adam Johnson 120 days ago · Tech · hide · Fediverse post Back in January, I introduced tprof, a targeting profiler for Python 3.12+ that measures the time spent in specific functions, rather than your whole program. As a reminder, here’s the basic usage, specifying a target function with -t and a script to run: $ tprof -t lib:maths ./example.py ... 🎯 tprof results: function calls total median ± σ min … max lib:maths() 2 610ms 305ms ± 2ms 304ms … 307ms Today, it’s my pleasure to announce tprof 1.3.0, a big release with the following changes. Way less overhead tprof previously stored each recorded call as a Python int inside a dict of lists, then used the statistics module to crunch the numbers at report time. These data structures were easy to write in an initial version and get the project going, but it added meaningful overhead to every monitored call. The new release replaces all of that with per-thread C structures: a stack of entry times and a flat array of durations per target, storing raw nanosecond int64_t values instead of boxed… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town