Event ·Single source

用 Claude 写 SQLite parse_number() 扩展:C 与 Rust 性能对比

Simon Willison 让 Claude(Opus 5.5)编写一个 SQLite 扩展函数 parse_number(),将 '$1,234.56'、'12.5%' 这类字符串转为可求和排序的数值。Rust 版本编译产物为 298-321 KB,C 版本只有 14 KB,但 Rust 用 Rusqlite 时每行处理仅需 46 ns,比初始 C 版本的 67 ns 更快。随后 Claude 手写新的 C 解析函数,将 200 万行数据的混合数据每行耗时降到 19 ns,超过 Rust 实现。整个研究过程最终整理成一份放在 GitHub 的研究报告。

Current read

Simon Willison 让 Claude 用 C 和 Rust 各写了个 SQLite 解析函数,手写的 C 版本最后跑出了 19 ns/行的成绩,过程很值得看。

2 sources51° AI heatLast updated 2026/11/8 22:26:00

Evidence

2 sources
Primary sourceSimon Willison’s Weblog
View source

Conflict check

Dedup data only shows that these sources discuss the same event, not that they agree. There is no structured supporting or refuting evidence yet, so no conflict is inferred automatically.

Claude builds a SQLite parse_number() extension in C and Rust · 事件专题 | AITOP