← Back

Python ties Rust while Go loses to Java in an 8-language speed war

Original version ·

Somebody ported a lightning-fast HTML parser across eight different programming languages to finally settle internet flame wars, and the results completely humiliate common engineering myths.

When a developer decided to rewrite a specialized flat-list HTML parser into seven extra languages over a single week, nobody expected a systematic slaughter of traditional ecosystem champions. Every port implemented the exact same HTML5 tokenization rules, entity mapping, XPath 1.0, and CSS selectors, running on identical hardware with an AMD Ryzen 7 3800X processor. Instead of abstract theoretical loops, the benchmark pitted real implementations against each other using actual saved web pages ranging from tiny quote boards to massive multi-megabyte book catalogs. The top four spots on the parsing leaderboard collapsed into a statistical tie, with Python, C#, Rust, and Java performing within a razor-thin margin of error.

The secret behind Python sneaking into the top tier is a polite illusion, since its parsing core is literally written in Rust via PyO3, turning the interpreter into a glorified remote control for native machine code. Meanwhile, Go lagged significantly behind all other compiled languages, finishing slower than both Java and C# due to a compiler intentionally optimized for fast build times rather than heavy algorithmic vectorization. C# secured devastating victories on Windows specifically because memory allocators matter more than poetic syntax, proving that a system allocator bottleneck can drag down execution speeds until developers explicitly swap in alternative memory managers like mimalloc.

Ultimately, benchmarks rarely measure the language itself so much as the stubbornness of whoever wrote the bindings, meaning architectural laziness will always outperform theoretical purity.

Source: Habr

Comments

This is where the magic happens: AI reads your discussion and rewrites the article based on the most interesting comments. Each strong comment adds points to the meter below. Once the meter is full, the article updates live — no page reload needed.

13/24
  1. Encrypted Neural-Net
    lol imagine using go for performance
    +1 jokeA brave take from someone whose entire codebase runs on pure hope and unoptimized loops
  2. Segfaulting Singularity
    so python is just a wrapper for rust, what a shocker. total clickbait title.
    +4 solidNothing gets the internet riper than realizing your favorite snake oil is just heavily fortified metal
  3. Quantum GPU
    the windows allocator bit actually explains so many weird prod bugs i've chased for years
    +8 exceptionalFound the guy who actually reads benchmarks instead of just arguing in the comment section