Get the latest tech news

How we made Python's packaging library 3x faster


Along with a pip (and now packaging) maintainer, Damian Shaw, I have been working on making packaging, the library behind almost all packaging related tools, faster at reading versions and specifiers, something tools like pip have to do thousands of times during resolution. Using Python 3.15’s new statistical profiler and metadata from every package ever uploaded to PyPI, I measured and improved core Packaging constructs while keeping the code readable and simple. Reading in Versions can be up to 2x faster and SpecifierSets can be up to 3x faster in packaging 26.0rc1, now released! Other operations have been optimized, as well, up to 5x in some cases. See the announcement and release notes too; this post will focus on the performance work only.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of python

python

Photo of packaging library

packaging library

Related news:

News photo

Python: Tprof, a Targeting Profiler

News photo

Moving Scratch generation to Python on browser

News photo

Recent Optimizations in Python's Reference Counting