pypi / line-profiler
line-profiler
What changed in line-profiler 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
1 breaking2 new APIs and options1 performance12 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initline-profiler 516 changes
Breaking changes 1
Text output no longer defaults to alphabetical ordering of profiled functions.
New APIs and options 2
LineStats aggregation is added, allowing line statistics to be aggregated.
Adds an IPython magic function for profiling with %%lprun_all.
Performance 1
Worst-case overhead is reduced, improving performance when profiling.
Fixes and other changes 12
Decorating a function no longer destroys its type.
Handling of multi-target from-import statements was fixed.
kernprof now always runs code in sys.modules['__main__']'s namespace.
Running kernprof.main no longer reverts the entirety of sys.modules.
Bytecode for profiled functions is always padded.
Recursive calls are now counted correctly.
The typing of ScopingPolicy members was fixed.
Unencodable characters are escaped instead of causing lines to be dropped.
A type fix was made to the base; the notes do not specify further details.
File resolution for files executed with kernprof -m now uses the import system.
Fixes and build changes improve compatibility with Python 3.14, including preventing duplicate output.
Reference-count leaks are fixed.