Developer ports JavaScript glob library Picomatch to Rust, finds it 18x slower
A developer ported Picomatch, a widely used JavaScript glob-matching library, to Rust over 72 hours, pinning the project to a specific upstream commit and building a standalone Rust scanner, compiler, and matcher. Despite passing all 1,977 inherited tests plus 28 native Rust tests, the Rust implementation processed roughly 395,000 matches per second compared to Node's 7.18 million — about 18 times slower. Further differential testing uncovered subtle Unicode compatibility bugs, including edge cases around the Latin long s and the Kelvin sign, which behave differently under JavaScript's legacy versus Unicode-aware case-insensitive regex modes. To address this, the developer derived a complete legacy Canonicalize table for all 65,536 Basic Multilingual Plane code units from Node 24.18.0, generating over 4,700 additional test checks. The project highlights how passing an inherited test suite does not guarantee correctness, particularly when porting code that relies on language-specific runtime behaviors.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in