Sharpening the Knife

SQLite, a C library that implements an SQL database engine, is the most widely deployed database engine in the world. The system is extraordinarily stable. One of the reasons is that although SQLite contains about 89.9 KSLOC it has 91493.0 KSLOC of test code and scripts. Follow the last link to see what’s involved in that testing. One hundred percent coverage and regression tests are only part of it. If every project did as well, we’d have a lot less buggy software. It reminds me of Walter Bright (of Zorland C/C++ and D programming languages fame) who once wrote that over the years he has accumulated a set of regression tests for his code generator that tests every error he has ever found.

As Magnar Sveen said in Episode 4 of Emacs Rocks!, it’s all about sharpening the knife. The SQLite developers know a thing or two about knife sharpening. The latest version of SQLite (3.8.7) is 50% faster than version 3.7.17 due to micro-optimizations. They say that each optimization may contribute as little as 0.05% improvement but over the hundreds of such optimations they’ve achieved a spectacular improvement. Read the article to get an idea of what they did. Really, they’re an inspiration to us all.

This entry was posted in Programming and tagged . Bookmark the permalink.