LLM-Generated Code Appears Functional But Performs 20,000x Slower Than SQLite
By
dnw
2mo ago· 21 min readenInsight
100/100
Golden Brown
Bagelometer↗
Master baker tier. Every paragraph earns its place on the tray.
Score100TypeanalysisSentimentnegative
Summary
The article critiques LLM-generated code by comparing a simple database operation between SQLite and an LLM-generated Rust rewrite. While the LLM code compiles, passes tests, and appears functional on the surface, it performs 20,171 times slower on basic operations like primary key lookups. The author argues that LLMs produce 'plausible' code that looks correct but is fundamentally inefficient and impractical for real-world use, highlighting the gap between syntactically correct code and performant, production-ready software.
Key quotes
· 5 pulledSQLite takes 0.09 ms. An LLM-generated Rust rewrite takes 1,815.43 ms.
The rewrite is 20,171 times slower on one of the most basic database operations.
The code compiles. It passes all its tests. It reads and writes the correct SQLite file format.
At first glance it reads like a working database engine. But it is not!
Your LLM Doesn't Write Correct Code. It Writes Plausible Code.
One of the simplest tests you can run on a database:
