Skip to content
InfoNewsLLM-specific

parse_number() as a SQLite extension: C vs Rust

Published
Record updated
View JSON

Summary

A researcher compared building a SQLite custom function parse_number() in C versus Rust, using Claude chat to generate both prototypes. The Rust extensions were 321 KB (rusqlite) and 298 KB (sqlite-loadable-rs) against 14 KB for the initial C build, and Rust ran faster because its strtod equivalent was twice as fast. A rewritten C parser then matched or beat Rust, with net cost per row over 2 million rows of 19 ns for mixed data versus 46 ns and 41 ns for the Rust builds.