# What changed in line-profiler

> 16 changes in line-profiler 5 from its official release notes, upgrade guides and advisories: 1 breaking, 2 new APIs and options. Each one cited. Sources checked 2026-10-21. HTML: https://unstale.sh/pypi/line-profiler/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## line-profiler 5

### Breaking changes

- Text output no longer defaults to alphabetical ordering of profiled functions. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)

### New APIs and options

- LineStats aggregation is added, allowing line statistics to be aggregated. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)
- Adds an IPython magic function for profiling with %%lprun_all. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)

### Performance

- Worst-case overhead is reduced, improving performance when profiling. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)

### Fixes and other changes

- Decorating a function no longer destroys its type. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- Handling of multi-target from-import statements was fixed. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- kernprof now always runs code in sys.modules['__main__']'s namespace. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- Running kernprof.main no longer reverts the entirety of sys.modules. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- Bytecode for profiled functions is always padded. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- Recursive calls are now counted correctly. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- The typing of ScopingPolicy members was fixed. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- Unencodable characters are escaped instead of causing lines to be dropped. (5.1.0) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.1.0)
- A type fix was made to the base; the notes do not specify further details. (5.0.2) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.2)
- File resolution for files executed with kernprof -m now uses the import system. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)
- Fixes and build changes improve compatibility with Python 3.14, including preventing duplicate output. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)
- Reference-count leaks are fixed. (5.0.1) — [release notes](https://github.com/pyutils/line_profiler/releases/tag/v5.0.1)
