- 1.72K Posts
- 4.31K Comments
I thought the biggest problem for Python would be the GIL as it cannot share memory between processes and therefore needs to do use a database or other tool to share between them. Though in hindsight most web related services probably use databases to read and write data and this do not work out of shared process memory.
I thought Rust was faster for basically every metric?
The entire advantage of Python is supposed to be ease of development, in exchange for slower code execution. It is especially bad in terms of multiprocessing, which Rust is great at.
As I severely lack expertise on back-end development I asked for clarification to the forbidden oracle (AI) but it also told me that Rust is faster. I am not sure whether you feel like debunking an AI comment but if this is false I would love to hear why because from my current understanding Rust is always faster (for back-end development).
AI response
That statement is technically false, but it contains a grain of practical truth that often confuses people.
Here is the breakdown of why that statement is misleading and where the misunderstanding comes from.
The Verdict: False
Rust is almost invariably faster than Python, even in IO-bound tasks.
If you have a web server handling 10,000 concurrent connections that are all waiting on a database (pure IO-bound), the Rust server will use significantly less RAM and CPU to manage those “waiting” connections than the Python server.
Why the statement is wrong (The Technical Reality)
The argument assumes that “IO-bound” means the CPU does zero work. That isn’t true. Even in an IO-heavy application, the application server must do the following:
-
Event Loop Management
The server has to track which connections are waiting and which are ready to resume.- Rust’s async runtimes (like Tokio) are incredibly optimized and have near-zero runtime overhead.
- Python’s
asyncioloop has significant overhead because it is still running interpreted Python code to manage the tasks.
-
Serialization/Deserialization
When the database replies, the server receives raw bytes. It must turn those bytes into objects (JSON parsing, ORM model instantiation). This is CPU-bound work.- Rust does this near-instantly.
- Python is notoriously slow at object instantiation.
-
The GIL (Global Interpreter Lock)
Even if your code is async, Python can only execute one bytecode instruction at a time per process.- If 100 requests come back from the DB at the exact same millisecond, Python has to process them one by one.
- Rust can process them in parallel across all CPU cores.
Where the statement is “Practically” True (The Grain of Truth)
The person making that statement is likely conflating “faster” with “indistinguishable to a human.”
If a database query takes 100ms:
- Rust overhead: 0.1ms → total response ≈ 100.1ms
- Python overhead: 5.0ms → total response ≈ 105.0ms
To the human user, 100.1ms and 105ms feel exactly the same.
In this specific context, you could argue that Python is “just as fast” as Rust because the bottleneck is the database, not the language. But it is incorrect to say Python is faster.
The “Fediverse” Exception (Why it matters for PieFed)
The statement “web servers are IO-bound” is often true for something like a simple blog.
It is less true for the Fediverse.ActivityPub (the protocol PieFed and Lemmy use) involves two things that are heavily CPU-bound, not IO-bound:
-
JSON Parsing
Fediverse servers throw massive JSON blobs at each other constantly.- Python is slow at parsing JSON compared to Rust.
-
Cryptography (RSA Signatures)
Every time a server sends a message to another server, it must cryptographically sign it (HTTP Signatures). Every time it receives a message, it must verify the signature.- Rust handles crypto operations natively and extremely fast.
- Python relies on C-extensions (like
cryptography), which are fast, but the overhead of calling back and forth between Python and C for every single request adds up.
Conclusion
The statement is false.
- Rust is faster at raw execution.
- Rust is faster at handling high concurrency (even IO-bound).
- Python is only “faster” in one metric: development velocity – you can write the code faster in Python, but the code itself will not run faster than Rust.
-
IndustryStandardOPto
Crazy Fucking Videos•[Video] Explosion of F16 crash in California. Pilot ejected.English
4·4 天前https://abcnews.go.com/US/wireStory/air-force-pilot-safely-ejects-16-fighter-jet-128089663
The F-16C Fighting Falcon crashed around 10:45 a.m. during a training mission “over controlled airspace in California,” according to a statement from Nellis Air Force Base in Nevada.
IndustryStandardto
World News•Top US official berates Europe over cutting American industry out of defense buildupEnglish
8·4 天前The EU is buying a ton of American weapons though?
IndustryStandardto
World News•German army chief says contact with US military cut off by PentagonEnglish
5·4 天前Germany should build up a massive army to pre-emptively invade Russia. But first they should unite the rest of Europe. It is very pressing so there is no way to do this except by toppling their corrupt regimes. In fact lets start with Poland.
Piefed uses Python which is faster for development but the language is slower. Lemmy is built on Rust. I appreciate some features Piefed has but I do wonder about its scalability.
IndustryStandardto
News•‘America, uh...First!’: ICE to buy $7.2m worth of Canadian armored personnel carriers
14·6 天前Canada is a big weapons supplier to Israel, the modern day Nazis. If that does not break their code of conduct nothing will.
IndustryStandardto
Fuck Cars•Zohran Mamdani hires car-hating activist Ben Furnas for NYC transportation team: ‘War on drivers’English
51·6 天前NYPost does not care about what their readers think. Their only job is to push a certain agenda. It is a propaganda rag.
IndustryStandardto
Linux Gaming•Linux continues to grow and has reached a new peak of 3.20% in the November 2025 Steam Hardware & Software SurveyEnglish
18·6 天前I like how all Arch based distros are in “quotes” by the way.
IndustryStandardOPto
World News@lemmy.ml•Germany wants to build Europe’s strongest army – a new conscription bill is moving that closer
1·6 天前It is a lot of slow frog boiling. They start off with “voluntary” so they can eventually introduce mandatory conscription without too much pushback.
Europe and the US are very likely gearing up to start World War 3 in a few years.
IndustryStandardtoMicroblog Memes•This stupid system that everyone hates has been like this for decadesEnglish
14·9 天前Sail the seven seas to medical tourism
IndustryStandardto
A Boring Dystopia•AI-powered surveillance firms are gunning for a share of the Gaza spoils
5·9 天前Dataminr? Can these names get any more on the nose.
IndustryStandardOPto
World News•Israeli forces execute two surrendered Palestinians at point-blank rangeEnglish
67·10 天前Video of the event here NSFL: https://i.imgur.com/upZhU77.mp4
IndustryStandardOPto
World News•Muslim Brotherhood rejects US terrorist designation, accuses UAE and Israel of involvementEnglish
7·11 天前To be fair, Venezuela is also a “terrorist organisation” now. The word does not mean anything except “does not align with the US”.
No it is okay because he worked under the Biden CIA, which is definitely not at all remotely the same as the Trump CIA whatsoever.
Not really. There are so many comments in a single Lemmy thread that continuing it would be a fools errand. Old forum threads were not much better besides often having more direct conversations with people. But I find that to be much better on Lemmy than on Reddit too.


















Adopting a mindset to reduce the amount of risky consumption is more effective than avoiding it at any cost.