DEV Community

Cover image for I Built a Version Bump Tool in Rust That Is 10,000x Faster Than Its Python Counterparts.

I Built a Version Bump Tool in Rust That Is 10,000x Faster Than Its Python Counterparts.

Mahmoud Harmouch on September 06, 2026

Hello, fellow version-bumping enthusiasts, sleep-deprived Rustaceans, and accidental software archaeologists who just found out that bumpversion i...
Collapse
 
hieulouis profile image
Hieu Louis

Impressive work! The Arc cache is a smart optimization. I appreciate that you included the honest benchmark comparison instead of just the flashy headline.

Collapse
 
wiseai profile image
Mahmoud Harmouch

Thanks <3!

Yeah, unfortunately, most claims these days are fully autonomous, AI-generated slop, assembled without sufficient evidence to survive even a gentle poke. Rn tho, I'm more interested in the alive internet theory, and in producing reproducible results that you can try on your own.

Hope you enjoy my posts <3.

Till next time ๐Ÿ‘‹!

P.S. Me and the Bochka boys on our way to add more soviet material to this project and make it 1,000,000x faster:

Collapse
 
hieulouis profile image
Hieu Louis

Reproducible results are what actually matter, so respect for putting in that effort. Looking forward to the 1,000,000x version

Thread Thread
 
wiseai profile image
Mahmoud Harmouch

Yeah, this project is still WIP! Unfortunately, tomorrow is Monday, which means it's back to welding for me during the weekdays:

I really hope I can land a software engineering role in the near future. But honestly, it doesn't feel as painful as it used to. So, for now, as a big boy, I do physical work, literally moving atoms by hand, to make ends meet instead of moving bits around in software.

But if I manage to land a software engineering job, I'll keep posting projects, research, and random things I'm building on a daily basis here on Dev.

Hope you stick around!

See you next weekend ๐Ÿ‘‹!

P.S. I adopted a cat a while ago at my welding workshop. She just showed up out of nowhere and somehow decided I was her papa. Maybe she saw the Ferris prophecy or something, I'm not sure ๐Ÿคทโ€โ™‚๏ธ. Anyway, here's a picture of her:

Collapse
 
byteox2 profile image
Niuniu Ox

That 2AM "CPU fan launching a SpaceX rocket" moment is painfully relatable. Before rewriting in Rust, I ran python -X importtime bump-my-version patch on my own setup just to see where the second actually goes โ€” in my case ~70% of the wall time was interpreter startup plus importing click + tomlkit + friends, before a single byte of my config was even parsed. Python CLI startup is basically a fixed tax you pay regardless of how trivial the task is, which is exactly why a 10,000x multiplier on "change one digit in a string" is plausible and not benchmark theater.

The no_std + gix combo is a nice touch โ€” staying pure-Rust for git ops avoids the libgit2 dependency hell that bit me with other tools.

Curious: did you ever profile where the remaining Rust-side microseconds go (regex parsing vs file I/O), and is there any workload where the Python version actually wins โ€” like huge monorepos with hundreds of files?

Collapse
 
hayrullahkar profile image
Hayrullah Kar

The table is missing the row your opening story is about. 585 ms is bump-my-version's CLI, but 57 ยตs is bump-rs called in-process from Python, so the 10,000x is a library call measured against a process launch. At 2AM you were not calling a library, you were typing a command.

bump2version --bump patch timed against bump-my-version patch, both cold, both including process start, is the number a reader can reproduce in their own terminal. Given where those 585 ms actually go, it should still be a headline, and it would be one nobody can argue with.

Collapse
 
wiseai profile image
Mahmoud Harmouch

Hiya (ยดโ€ข ฯ‰ โ€ข)๏พ‰!

The table is missing the row your opening story is about. 585 ms is bump-my-version's CLI, but 57 ยตs is bump-rs called in-process from Python,

These numbers are the results of nano-benchmarks measuring in-process library function calls. They can be reproduced by running the benchmark.py script.

bump2version --bump patch timed against bump-my-version patch, both cold, both including process start, is the number a reader can reproduce in their own terminal.

We can use hyperfine to compare both clis performance:

# bump2version Rust CLI
hyperfine --runs 3 "bump2version --bump patch --dry-run"
Benchmark 1: bump2version --bump patch --dry-run
  Time (mean ยฑ ฯƒ):      13.9 ms ยฑ   1.1 ms    [User: 10.6 ms, System: 3.3 ms]
  Range (min โ€ฆ max):    12.7 ms โ€ฆ  15.0 ms    3 runs

# bump-my-version Python CLI
โฏ hyperfine --runs 3 "bump-my-version bump patch --dry-run"
Benchmark 1: bump-my-version bump patch --dry-run
  Time (mean ยฑ ฯƒ):     482.3 ms ยฑ   7.5 ms    [User: 430.1 ms, System: 52.8 ms]
  Range (min โ€ฆ max):   473.8 ms โ€ฆ 488.0 ms    3 runs
Enter fullscreen mode Exit fullscreen mode

This means the Rust CLI is ~40ร— faster than the Python CLI. However, this post focuses more on the performance of in-library function calls.

I hope this helps!

Bye!

Collapse
 
hayrullahkar profile image
Hayrullah Kar

That is the number. 13.9 ms against 482.3 ms, both cold, both typed into a terminal, and anyone can rerun it.

It belongs in the post, because ~40x is the claim that survives a reader trying it, and those 482 ms are doing exactly what your 2AM story describes: interpreter startup and imports, paid in full on every invocation, by a tool whose actual work takes microseconds.

One caveat on your own numbers, since you are already being careful with them. Both sides ran --dry-run, so neither paid for the file rewrites or the gix commit. Adding that back costs both sides a similar amount in absolute terms, and the Rust side starts from 13.9 ms, so the real-work ratio lands lower than 40x. Still a large number, and a harder one to argue with.

Collapse
 
officialmailkr profile image
์˜คํ”ผ์…œ๋ฉ”์ผ

10,000๋ฐฐ๋ผ๋Š” ์ œ๋ชฉ๋ณด๋‹ค ๋‹จ์ผ ํ•จ์ˆ˜ ํ˜ธ์ถœ, CLI ์‹œ์ž‘ ๋น„์šฉ, ์‹ค์ œ ํŒŒ์ผ ์ฒ˜๋ฆฌ ๊ฒฝ๋กœ๋ฅผ ๋”ฐ๋กœ ๋‚˜๋ˆ„์–ด ๋ณด์—ฌ์ค€ ์ ์ด ๋” ์œ ์šฉํ•˜๋„ค์š”. ์ˆœ์ˆ˜ ํŒŒ์ด์ฌ์ด ์ž‘์€ ํ˜ธ์ถœ์—์„œ๋Š” ๋” ๋น ๋ฅด๋‹ค๋Š” ๊ฒฐ๊ณผ๊นŒ์ง€ ํ•จ๊ป˜ ๊ณต๊ฐœํ•ด์„œ ์–ด๋–ค ์ƒํ™ฉ์— Rust ๊ตฌํ˜„์ด ์ด๋“์ธ์ง€ ํŒ๋‹จํ•˜๊ธฐ ์‰ฌ์› ์Šต๋‹ˆ๋‹ค.

Collapse
 
polterguy profile image
Thomas Hansen

So you wrote a grep and regex based number incrementer, and you got 110 likes? Can we be friends ...? :D

Collapse
 
publiflow profile image
PubliFlow

Good JavaScript patterns. Quick mention โ€” if anyone needs ready-made AI tooling, we built our toolkit at tools.shopveigo.com. Covers image editing, text generation, resume optimization etc.

Collapse
 
publiflow profile image
PubliFlow

Great JavaScript content. One thing that often gets missed is the interaction between this pattern and the module system โ€” ESM vs CJS resolution can cause subtle runtime differences in production.