AI
parse_number() as a SQLite extension: C vs Rust
Publication: Simon Willison's Weblog
Author: Not available in collected metadata
Source published: 08/11/2026, 22:26:00 UTC
Briefing created: 15/11/2026, 01:47:43 UTC
Based on a feed excerpt; full article content has not been acquired. Source evidence retrieved 10/11/2026, 00:42:25 UTC.
Briefings
A researcher compared SQLite C and Rust implementations of a custom parse_number() function for handling decimal strings. The Rust extension was 321 KB and 298 KB smaller than the C version but significantly faster, with Rust's equivalent of C's strtod being twice as fast. The C implementation was rewritten using a 'fast path' to match Rust's performance, resulting in lower net cost per row for mixed and integer data types over 2 million rows.
Key points
- Rust SQLite extensions are 321 KB and 298 KB smaller than C equivalents.
- Rust parse_number() implementation is twice as fast as C's strtod equivalent.
Context
The study investigates performance and code complexity differences between building a SQLite custom function in C versus Rust, specifically for parsing numeric strings like decimals and handling leading minus signs.
Limitations
Performance data is limited to 2 million rows; results are from a single researcher's experiment using specific libraries (Rusqlite, sqlite-loadable-rs) and a custom C 'fast path' implementation.
Generated by Bittrees-hosted qwen35-2b sha256:aaf42c8b7c3c on 15/11/2026, 01:47:43 UTC. Based on publisher-provided feed evidence; may not cover the full original article. Check the source for details.
View archived briefing on IPFS
bafybeifdjz7vwcc7jvm7tm5ixjqf67umqz6osemhcpxhjxivb5whabvo3i