For most backend services, Python is the faster way to ship and Rust is the faster way to run. Rust makes sense when a service is bound by CPU, memory, or tail latency, such as a proxy, a cache, or a sync engine. Python makes sense when the bottleneck is the database, the network, or developer time. The two are also increasingly combined, with Rust doing the heavy lifting inside Python libraries. This guide compares them on speed, concurrency, safety, cost, and team factors, using real company examples and avoiding invented benchmark numbers.
First, a Warning About Benchmarks
Many Python-versus-Rust articles quote framework benchmark tables. Be careful with them. The TechEmpower Framework Benchmarks repository on GitHub was archived on March 24, 2026 and is read-only. The last official round, Round 23, was announced on March 17, 2025, on new Microsoft-provided servers with 56 cores and 64GB of memory. TechEmpower said the top frameworks improved about threefold in practical network-bound tests. The benchmark is synthetic, the implementations were contributed by vendors and communities, and database-bound tests narrow the gaps between languages. This research could not retrieve per-framework figures for Axum, Actix, FastAPI, or Django, so none are quoted here. Treat any specific requests-per-second number you see as a snapshot, not a ranking.
What Changed in Python
Free-Threaded Python Is Officially Supported
The biggest shift is concurrency. PEP 779 is marked Final (resolved June 16, 2025) and defines three phases: experimental free-threaded builds in Python 3.13, officially supported but optional in Python 3.14, and a future phase where free-threading becomes the default. That last phase needs another proposal and has not happened.
Python 3.14 was released on October 7, 2025. Its documentation says the single-thread penalty for free-threaded builds is roughly 5 to 10 percent. The free-threading how-to notes that overhead varies from about 1 percent on macOS aarch64 to 8 percent on x86-64 Linux. It also warns that importing a C extension not marked compatible re-enables the Global Interpreter Lock (GIL). To check, run a one-line script that prints the result of the sys._is_gil_enabled function, or use the PYTHON_GIL=0 setting to force the GIL off.
Other 3.14 Features
Python 3.14 added a concurrent.interpreters module for subinterpreters (PEP 734) with an InterpreterPoolExecutor, though the documentation notes limits such as unoptimized startup and higher memory use. macOS and Windows binaries support the experimental JIT. An opt-in tail-call interpreter built with Clang 19 or later showed a geometric mean of 3 to 5 percent faster on the pyperformance suite, which the documentation calls preliminary.
Python 3.15
The Register reported on May 11, 2026 that Python 3.15 beta 1 shipped with a JIT that gave a mean speedup of 8 to 9 percent on x86-64 Linux and 12 to 13 percent on Apple silicon, with some code up to 15 percent slower. The final release was slated for October 1, 2026, and this article could not confirm as of October 17, 2026 that it has shipped.
Where Rust Wins
Predictable Latency and Memory
Rust has no garbage collector. Discord’s 2020 engineering post about its Read States service, which moved from Go to Rust, is the best-known illustration. Go’s garbage collector forced a run at least every two minutes, causing latency and CPU spikes. After the port, completed in May 2019, Rust beat Go on latency, CPU, and memory with no spikes, and the team raised the cache to 8 million read states. The caveat is that this was a cache-heavy single service, and the comparison was Go versus Rust, not Python versus Rust.
Infrastructure-Level Throughput
Cloudflare built Pingora in Rust to replace NGINX in its edge network. Its September 2022 post says the proxy handles over a trillion requests per day, uses about 70 percent less CPU and 67 percent less memory at the same traffic, and cut median time to first byte by about 5 milliseconds and the 95th percentile by about 80 milliseconds. Connection reuse for one customer rose from 87.1 to 99.92 percent. These are company-reported results for a very specific workload.
Correctness
Dropbox rewrote its desktop sync engine from Python, called Sync Engine Classic, to Rust, called Nucleus, over about four years. Its March 2020 post cites correctness and testability, not raw speed, as the reasons, and says “Rust has been a force multiplier.” The post gives no speedup figure.
Where Python Still Wins
Time to Market and Ecosystem
The Stack Overflow 2025 Developer Survey found Python used by 57.9 percent of all respondents, up seven points from 2024, while Rust was used by 14.8 percent. Rust was the “most admired” language at 72 percent. Admiration is not adoption, and the survey data say nothing about backend performance.
Pragmatic Tuning
Instagram’s engineering team stayed on Python and Django and tuned instead of rewriting. Its post (undated on the page, from about 2017 per its listing) says that disabling Python’s garbage collector gave about a 10 percent capacity gain, that per-worker shared memory grew from 140MB to 225MB, and that about 25 percent of RAM was saved across the fleet. It is old, but it shows that a mature Python service can often gain more from profiling than from a rewrite.
When the Database Is the Bottleneck
If a request spends most of its time waiting on a database or an external API, a faster language changes little. The TechEmpower caveat above makes the same point.
The Hybrid Path: Rust Inside Python
The most practical answer is often both. Pydantic V2’s validation core is written in Rust (the pydantic-core package), and its authors claimed in April 2023 that it was “5-50x faster than Pydantic V1,” though the page gives no methodology. PyO3, a library for writing Python extensions in Rust, lists polars, pydantic-core, orjson, tokenizers, cryptography, and granian among example projects. Its guide, for version 0.29.3, requires Rust 1.83 or later, and the maturin tool builds and publishes the packages. The exact maturin commands were not verified from documentation for this article, so follow the PyO3 guide.
This approach lets a team keep Python for the application and move only the hot loop into Rust, often one function at a time.
Decision Framework
Choose Python When
The service is mostly I/O-bound, the team already knows Python, the product is still changing quickly, or you depend on its data and machine learning libraries.
Choose Rust When
You are building a proxy, gateway, cache, or sync engine, tail latency matters, memory per connection is costly, or the cost of a bug in production is high.
Choose the Hybrid When
You have a working Python service and a profiler showing one or two hot paths.
The Cost of Learning Rust
The State of Rust 2025 survey, with 7,156 completed responses, reported that debugging concern fell from second to fourth place, and that compile times remain a productivity issue. It gave no numeric data on learning curve in the text reviewed. Hiring and onboarding costs are a real factor, and this research did not find hard figures on them.
A Practical Migration Plan
- Profile the Python service and find where time actually goes.
- Try cheaper fixes first, such as caching, query tuning, and async I/O.
- Test free-threaded Python 3.14 for CPU-bound threads, checking that your C extensions are compatible.
- If one function dominates, rewrite it in Rust with PyO3.
- Move whole services to Rust only when the evidence supports it.
How to Run a Fair Comparison on Your Own Workload
Because published benchmark tables are snapshots, the most reliable test is your own. Pick one realistic endpoint, such as a request that reads from your database, transforms the result, and returns JSON. Build it in both languages with the frameworks you would actually use. Run the same load against both on the same hardware, and record median latency, 99th percentile latency, memory use, and CPU use under steady load, not just peak requests per second. Include a database call, since TechEmpower’s own results show that database-bound tests narrow the gaps between languages. Repeat the test with realistic data sizes. If the difference is small compared with your team’s cost to maintain two codebases, the answer is clear.
Questions About Team and Cost
Speed is only one input. Ask how many engineers on your team can read and review Rust code today, and how long a new hire takes to become productive in it. The State of Rust 2025 survey notes that compile times remain a productivity issue, which affects feedback loops. On the Python side, ask whether the work involves libraries for data or machine learning that have no Rust equivalent of the same maturity. The Stack Overflow figures, 57.9 percent for Python against 14.8 percent for Rust among all respondents, say nothing about quality but do suggest the size of each hiring pool.
A Rule of Thumb
Use Python until a measurement says otherwise. When the profiler points at a small hot path, move that path to Rust through PyO3 before considering a full rewrite. When a new service is a proxy, a cache, or anything where tail latency and memory per connection are the product, start in Rust. That mirrors the company examples above: Cloudflare and Discord built latency-sensitive components in Rust, while Instagram kept Python and tuned it.
What Free-Threading Means for Your Choice
Free-threaded Python changes one old argument, that the GIL stops Python using several cores in a single process. With a free-threaded build, threads can run in parallel, at the price of the 5 to 10 percent single-thread penalty the documentation cites and the need for compatible extensions. That makes a Python service more competitive for CPU-bound work than it was, but it does not erase Rust’s advantages in memory use and latency predictability. Test your actual dependencies first, since one incompatible extension can re-enable the GIL.
Common Mistakes in This Debate
Do not compare a tuned Rust service with an untuned Python one, or the reverse. Do not quote a benchmark without knowing whether the test hit a database. Do not assume a rewrite will pay for itself, since Dropbox’s four-year effort was justified by correctness, not speed. And do not treat the languages as exclusive, since pydantic-core, orjson, and polars are Rust inside Python projects that millions of developers use without writing Rust.
Frequently Asked Questions
Is Rust faster than Python for backends?
Usually, for CPU-bound work. For database-bound services the gap often shrinks.
Is the GIL still a problem in Python?
Python 3.14 officially supports free-threaded builds with a single-thread penalty of roughly 5 to 10 percent. Extensions that are not compatible re-enable the GIL.
Should I rewrite my Python backend in Rust?
Profile first. Dropbox and Discord had specific reasons, and Instagram chose to tune Python instead.
Can I use both?
Yes. PyO3 and maturin let you build Python packages with Rust cores.
Are TechEmpower benchmarks still maintained?
The repository was archived in March 2026, and Round 23 from March 2025 was the last official round.
References and Sources
GitHub, “TechEmpower/FrameworkBenchmarks”: https://github.com/TechEmpower/FrameworkBenchmarks
TechEmpower, “Framework Benchmarks Round 23”: https://www.techempower.com/blog/2025/03/17/framework-benchmarks-round-23/
Python.org, “PEP 779”: https://peps.python.org/pep-0779/
Python Docs, “What’s New In Python 3.14”: https://docs.python.org/3/whatsnew/3.14.html
Python Docs, “Python support for free threading”: https://docs.python.org/3/howto/free-threading-python.html
The Register, “Feature freeze for Python 3.15 as first beta released”: https://www.theregister.com/devops/2026/05/11/feature-freeze-for-python-315-as-first-beta-released/5237934
Stack Overflow, “2025 Developer Survey: Technology”: https://survey.stackoverflow.co/2025/technology
Discord, “Why Discord is switching from Go to Rust”: https://discord.com/blog/why-discord-is-switching-from-go-to-rust
Cloudflare, “How we built Pingora, the proxy that connects Cloudflare to the Internet”: https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/
Dropbox Tech, “Rewriting the Heart of Our Sync Engine”: https://dropbox.tech/infrastructure/rewriting-the-heart-of-our-sync-engine
Instagram Engineering, “Dismissing Python Garbage Collection at Instagram”: https://instagram-engineering.com/dismissing-python-garbage-collection-at-instagram-4dca40b29172
Pydantic, “Pydantic V2 alpha”: https://pydantic.dev/articles/pydantic-v2-alpha
PyO3, “PyO3 user guide”: https://pyo3.rs/
Rust Blog, “2025 State of Rust Survey Results”: https://blog.rust-lang.org/2026/03/02/2025-State-Of-Rust-Survey-results
