From 751d2bc242c0ffbc119111fbc74462d1bd666f57 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Thu, 1 Aug 2024 22:15:49 +0100 Subject: [PATCH] Bump version: v4.7.0 --- README.md | 11 +++++++++++ docs/conf.py | 2 +- pyinstrument/__init__.py | 2 +- pyinstrument/stack_sampler.py | 4 ++-- setup.py | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 539d8030..0db982b4 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,17 @@ Known issues Changelog --------- +### v4.7.0 + +_1 August 2024_ + +- Adds a new, convenient API for [profiling chunks of Python code](https://pyinstrument.readthedocs.io/en/latest/guide.html#profile-a-specific-chunk-of-code)! You can now profile simply using a `with` block, or a function/method decorator. This will profile the code and print a short readout into the terminal. (#327) +- Adds new, lower overhead timing options. Pyinstrument calls timers on every Python function call, which is fine on systems with fast timing available, but it adds significant overhead on systems that require a syscall for each, such as some Docker environments. Pyinstrument will now detect slow timers present a warning with two choices. You can enable a 'timing thread', which offloads the timing workload from the profiled thread, or, if you're happy with lower resolution, you can opt to use a 'coarse' timer, which is provided on some Linux systems. (#273) +- Alt-click rows in the HTML output to collapse/expand the whole tree (#325) +- Adds a `flat` argument to the console output, to present a flat list of functions (#294) +- Adds a Litestar example config and docs (#284) +- Preliminary Python 3.13 support (#322) + ### v4.6.2 _26 January 2024_ diff --git a/docs/conf.py b/docs/conf.py index b09e81b7..21351cac 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = "Joe Rickerby" # The full version, including alpha/beta/rc tags -release = "4.6.2" +release = "4.7.0" # -- General configuration --------------------------------------------------- diff --git a/pyinstrument/__init__.py b/pyinstrument/__init__.py index d9a7fced..4b858904 100644 --- a/pyinstrument/__init__.py +++ b/pyinstrument/__init__.py @@ -4,7 +4,7 @@ from pyinstrument.profiler import Profiler __all__ = ["__version__", "Profiler", "load_ipython_extension", "profile"] -__version__ = "4.6.2" +__version__ = "4.7.0" # enable deprecation warnings warnings.filterwarnings("once", ".*", DeprecationWarning, r"pyinstrument\..*") diff --git a/pyinstrument/stack_sampler.py b/pyinstrument/stack_sampler.py index f08c6bfd..e2042bf2 100644 --- a/pyinstrument/stack_sampler.py +++ b/pyinstrument/stack_sampler.py @@ -216,7 +216,7 @@ def _check_timing_overhead(self, interval: float, timer_type: TimerType): return if timer_type == "walltime": - if overhead > 200e-9: + if overhead > 300e-9: self.has_warned_about_timing_overhead = True message_parts: list[str] = [] message_parts.append( @@ -237,7 +237,7 @@ def _check_timing_overhead(self, interval: float, timer_type: TimerType): """ ) - if "walltime_coarse" in overheads and overheads["walltime_coarse"] < 200e-9: + if "walltime_coarse" in overheads and overheads["walltime_coarse"] < 300e-9: coarse_resolution = walltime_coarse_resolution() assert coarse_resolution is not None message_parts.append( diff --git a/setup.py b/setup.py index 690b49d5..8d816b9f 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="pyinstrument", packages=find_namespace_packages(include=["pyinstrument*"]), - version="4.6.2", + version="4.7.0", ext_modules=[ Extension( "pyinstrument.low_level.stat_profile",