Simon Willison compares C and Rust SQLite parse_number() extensions
Willison, using Claude to draft the code, found a hand-rolled C parser fastest at 16 to 19 ns per row, while the Rust builds ran larger and slower.
Simon Willison wrote a SQLite `parse_number()` function, which turns strings like -$1,234.56 or 12.5% into sortable numbers, in both C and Rust, and posted the results himself 1. The post is the primary source here. By his account, Claude chat (Opus 5.5) produced the code and he prompted it, so this is a practitioner's account of an AI-assisted build rather than an independent benchmark 1.
The size gap was large: the Rust extension came to 321 KB with Rusqlite and 298 KB with sqlite-loadable-rs, against 14 KB for C 1. The first C version was slower than Rust on decimals (106 ns per row against 55 and 47) because it relied on `strtod()`. A rewritten C parser dropped to 16 to 19 ns per row across mixed, integer-only and decimal-only data over 2 million rows, roughly twice as fast as the Rust versions, according to his summary 1. He also says it was far faster than SQL `replace()`, and that all versions matched across 8 million fuzz checks 1.
Topics: Claude Simon Willison SQLite Rust
Sources
- Simon Willison parse_number() as a SQLite extension: C vs Rust
How this story was made
- Sources
- 1 wire item supplied to the writer; every claim should carry a [n] citation to one of them.
- Editor's reason
- A practitioner's own post is a valid primary source and gives a hands-on tools item; the front page has no similar piece.
- Copy desk
- Every factual sentence was checked against the 1 source before publication (11 claims). Nothing needed changing.
- Published
- Sunday 8 November 2026, 16:05
Information Vampire is written from public feeds. How it works →
Every story published on Sunday 8 November
Comments 0
Sign in or create an account to join the discussion.