# c 55

Published articles for c 55.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## parse\_number() as a SQLite extension: C vs Rust

DevFeed: [parse\_number() as a SQLite extension: C vs Rust](<https://devfeed.tech/articles/parse-number-as-a-sqlite-extension-c-vs-rust-122821.md>)

Original publisher: [Read original article](<https://simonwillison.net/2026/Nov/8/sqlite-parse-number-c-vs-rust/>)

Author: Simon Willison

Published: 2026-11-08T22:26:00Z

Content type: article

Language: en

Sources: [Simon Willison's Weblog](<https://devfeed.tech/sources/simon-willison-s-weblog.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [AI Chat](<https://devfeed.tech/topics/ai-chat.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [c-55](<https://devfeed.tech/tags/c-55.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-325](<https://devfeed.tech/tags/claude-325.md>), [function](<https://devfeed.tech/tags/function.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [performance](<https://devfeed.tech/tags/performance.md>), [research](<https://devfeed.tech/tags/research.md>), [research-12](<https://devfeed.tech/tags/research-12.md>), [rust](<https://devfeed.tech/tags/rust.md>), [rust-116](<https://devfeed.tech/tags/rust-116.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [sqlite-490](<https://devfeed.tech/tags/sqlite-490.md>)

### AI overview

The reported C SQLite extension was much smaller than the Rust versions (14 KB versus 321 KB with Rusqlite and 298 KB with sqlite-loadable-rs), but initially slower. Replacing C's strtod-based parsing with a custom parser using "Clinger's fast path" improved its reported net cost per row over two million rows: 19 ns on mixed data, 16 ns on integers, and 18 ns on decimals, compared with 46/36/55 ns for Rusqlite and 41/32/47 ns for sqlite-loadable-rs. The supplied excerpt describes the experiment and results but does not include implementation details or the full report.

### Source excerpt

Research: parse_number() as a SQLite extension: C vs Rust I was out walking the dog when I got curious about how easy/difficult it would be to write a SQLite C extension that adds a parse_number() function for turning strings like -$1,234.56 or '12.5%' into numeric values that could be summed and sorted. I fired up regular Claude chat (Opus 5.5) and prompted: I'm thinking about a SQLite custom function 'parse_number(value)' that strips ',', '$', 'GBP ' and '%', handles a leading '-', and returns 'NULL' for anything it can't parse Explore the difference between building this as a SQLite extension in C v.s. in Rust - I want to compare performance and code complexity and size of the resulting.so(or whatever) file This gave me a solid starting point - the Rust extension was 321 KB (using Rusqlite) and 298 KB (using sqlite-loadable-rs), while the C extension was 14 KB. But the Rust extension was faster! Turns out that's because the Rust equivalent of C's strtod is "twice as fast". So I prompted: Try writing your own C function for parsing text into a decimal number that catches up to or beats the Rust implementation And it did, using "Clinger's fast path": Net cost per row over 2 million rows, lower is better: first C new C rusqlite sqlite-loadable Mixed data 67 ns 19 ns 46 ns 41 ns Integers only 25 ns 16 ns 36 ns 32 ns Decimals only 106 ns 18 ns 55 ns 47 ns Finally, I had it rewrite the prototype as a research report to match the others in simonw/research by prompting this: Clone simonw/research from GitHub and turn your above investigation into a research report as seen in that repository - you can give me a zip file to download that contains your new folder Here's the resulting report. Tags: c, research, sqlite, rust, claude