Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Optimized My Bump Version Tool and Made It 1,000,000x Faster Than Its Python Counterparts.

Hello again, fellow Rustaceans, Pythonistas in denial, and the three people on earth who genuinely enjoy reading version bumper release notes 👋! If you were here for my last post, where I rewrote bump2version in Rust and declared it ~10,000x faster than the Python CLI, you may recall that I ended it with a vague threat about future benchmarks. The Mossad agents who consulted on the architecture…

In a recent post, the author revealed that they have significantly improved the performance of the bump2version tool, making it a whopping 1,000,000 times faster compared to its Python counterparts. The development of this faster version was driven by the demands of various programming languages such as Go, Java, and Ruby, which requested support for bump2version.

The Mossad agents, who oversee the project's architecture, came back with new requirements and a list of twelve slides. These included recommendations to use memchr for all hot-path string scanning, SmallVec for version component storage, branchless arithmetic for the bump itself, and watch mode that detects file changes.

The author implemented all these changes to meet the Mossad agents' expectations. They then released bump2version 0.2.1, which is now 1,000,000 times faster than its Python counterparts. The performance improvements were achieved through the use of memchr, a stack-allocated SmallVec, branchless bump arithmetic, and a shared regex cache. Additionally, a watch mode was added to the tool, allowing it to re-bump the version when a file changes, which can be useful for local development workflows.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 11 September →