Python: Tprof, a Targeting Profiler
4 months ago
- #Python
- #Performance
- #Profiling
- Introducing tprof, a targeting profiler for Python 3.12+ that measures time spent in specified functions only.
- tprof helps in quickly comparing performance before and after optimizations with a command-line report.
- Features include comparison mode for benchmarking 'before' and 'after' versions of functions, showing performance deltas.
- Provides a Python API via a context manager/decorator for profiling specific code blocks.
- Utilizes Python’s sys.monitoring API for low-overhead, targeted function profiling.
- Encourages community feedback and is available for installation via PyPI.