iCreatAI News
Skip to content
Simon Willison·· 7 days agoAI score18

parse_number() as a SQLite extension: C vs Rust

parse_number() as a SQLite extension: C vs Rust

AI summary

Four SQLite extensions implement the same parse_number() behavior in C and Rust, with tests covering type preservation, parsing rules, and floating-point accuracy. The optimized C implementation was fastest at 16–19 ns per row, about twice as fast as the Rust versions and far faster than SQL replace(). Plain C was slower on decimals because it relied on strtod(), while a compact fast path closed that gap; all versions matched across 8 million fuzz checks.

Source: Simon Willison · simonwillison.net