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: 09/11/2026, 04:31:00 UTC
Based on a feed excerpt; full article content has not been acquired. Source evidence retrieved 09/11/2026, 04:27:25 UTC.
Briefings
A researcher compared SQLite C and Rust implementations of a custom parse_number() function for parsing strings like '$1,234.56'. The Rust extension was 321 KB and 298 KB smaller than the C version, which was 14 KB. Performance tests on 2 million rows showed the Rust implementation was faster, with the Rust equivalent of C's strtod being twice as fast. The C extension successfully parsed integers and decimals, while the Rust version also handled these cases efficiently.
Key points
- The Rust extension for SQLite is 321 KB and 298 KB smaller than the C extension, which was 14 KB.
- The Rust implementation of parse_number() was faster than the C implementation on 2 million rows of mixed data.
Context
This article investigates the performance and code size differences between building a SQLite custom function in C versus Rust, specifically focusing on parsing numeric strings like '$1,234.56'.
Limitations
Performance data is limited to 2 million rows of mixed data; results for integers and decimals only are provided. The C extension was tested against the Rust equivalent of C's strtod function.
Generated by Bittrees-hosted qwen35-2b sha256:aaf42c8b7c3c on 09/11/2026, 04:31:00 UTC. Based on publisher-provided feed evidence; may not cover the full original article. Check the source for details.
View archived briefing on IPFS
bafybeias6sxi2niss76qor7d3vrxupbtrmzetri2kx34aw7fzysnbcbgsi