Python 3.15 Arrives with Lazy Imports and Tachyon Profiling
Python 3.15 arrived with explicit lazy imports, a new sampling profiler in the standard library and a small syntax addition for comprehensions. It is not faster than the previous version in general, and the most consequential change for developers may be that Python 3.10 is now out of support.
Reviewed by Matheus GrangeiroUpdated on

- Peer reviewed
- No
Evidence level: Release analysis with third-party benchmarks
Why it matters: Two of these changes remove the need for a workaround. Lazy imports attack the startup cost that makes command-line tools feel sluggish when a plugin pulls in a heavy dependency, and a built-in sampling profiler means diagnosing a slow process no longer requires installing an external tool. Both are the kind of change that shows up in daily work rather than in a benchmark.
What do lazy imports actually change? Normally an import runs when the file is read, so every dependency is loaded whether or not the code uses it. The new syntax from PEP 810 lets a developer write that an import is lazy, and the module is then loaded the first time one of its names is actually used.
Simon Willison explains why this matters with his own tool. His command-line program for language models supports plugins, and he had to tell plugin authors to write manual lazy imports, because simply installing a plugin that used a heavy dependency added multiple seconds to every single invocation of the command.
The new form addresses that startup cost directly, in the language rather than in each author’s discipline. It does not make code that is already running faster.
The second syntax change is smaller and welcome. Unpacking inside comprehensions, from PEP 798 by Adam Hartz and Erik Demaine, allows flattening a list of lists in one step, and it extends the unpacking syntax of PEP 448 that landed in Python 3.5 back in 2015.
A profiler that does not need you to plan ahead The tracing profiler was renamed from cProfile to profiling.tracing, and a sampling profiler called Tachyon joined it as profiling.sampling. The two work on opposite principles: tracing records every call, which is precise and slows the program, while sampling periodically grabs stack traces and works out where time is going from the statistics.
The practical difference is that sampling can be pointed at a process that is already running and misbehaving. Willison shows attaching to a live process by its identifier, interacting with the program, then stopping the capture to read a report, with flame graphs, heat maps and a format the Firefox profiler can open.
This capability existed before in external tools such as py-spy, and having it in the standard library changes who will use it. A developer debugging a production process on a machine where installing extra packages is awkward now has the tool already present.
Is it faster? Mostly not Miguel Grinberg measured the release candidate of Python 3.15 and found performance mostly the same as Python 3.14. That is a notable change of pace after a run of releases that did deliver speed.
The exception is the experimental just-in-time compiler, which gave a 1.2-times boost over the standard Python interpreter on a Fibonacci test, described as the first time Grinberg observed a meaningful gain from the JIT. One synthetic benchmark is the weakest kind of evidence about speed, and it matters here only because the previous measurements of the JIT showed nothing at all.
For comparison, Grinberg’s examination of Python 3.14 a year earlier found significant gains against Python 3.13 across many more categories, so the useful summary for anyone deciding whether to upgrade is that 3.15 is about features, not throughput.
The change with the widest reach is the one about support The end of support for Python 3.10, released in 2021, is what will produce the most code changes. A maintainer whose policy is to work on every supported version can now rely on features introduced in Python 3.11, and Willison lists exactly which ones he has been waiting for: tomllib in the standard library, TaskGroup and timeout for asyncio code, datetime.UTC, and a set of SQLite additions.
The SQLite list is a good illustration of how long these waits are. Being able to set runtime limits, create window functions from Python, read and write parts of a large binary value, and pass None to remove an authorizer are all features from 3.11, and Willison notes that Datasette carried a workaround for that last one, which he can now delete.
So the honest picture of this release is layered. Lazy imports and Tachyon are genuine additions a developer can use today, the speed story is flat, and the biggest practical effect is retroactive: a five-year-old version leaving support unlocks everything that arrived in the version after it.
Should you upgrade for the performance? It may seem that Python 3.15 is faster than 3.14. In fact: measurements on the release candidate found performance mostly unchanged, with a 1.2-times gain only from the experimental JIT on a Fibonacci test.
It may seem that lazy imports speed up running programs. In fact: they defer loading until a name is used, which attacks startup time rather than the speed of code already running.
It may seem that the sampling profiler replaces the old one. In fact: the tracing profiler was renamed and kept, and Tachyon is an addition that works by sampling instead of recording every call.
It may seem that the sampling profiler is entirely new. In fact: similar capability existed in external tools such as py-spy; the change is that it is now in the standard library.
It may seem that dropping Python 3.10 is a minor change. In fact: it is the change with the widest reach, because it unlocks Python 3.11 features for maintainers who support every supported version.
Verdict: A release of useful tools rather than speed, whose largest effect is that dropping Python 3.10 lets maintainers finally use what Python 3.11 added.
Based on reporting from Simon Willison. This is an independent explainer, written in our own words with AI assistance; Simon Willison has not reviewed or endorsed it. Read the original for the full details.