9 ms·
Size isn't everything for the modest creator of SQLite (2007)
- dalke 11y agoA nice interview, though from 2007. One thing has changed a smidgeon: "he has a self-imposed limit on the size of his product: 250KB. And he's stuck to both aims". The FAQ on sqlite.org says "With all features enabled, the library size can be less than 500KiB ... If optional features are omitted, the size of the SQLite library can be reduced below 300KiB." Close though!
- nly 11y agoAlso out of date. The 3.10.2 shared library is over 1 MiB on my system.
- dalke 11y agoCompiling with -Os brings it down to 800 KB. % gcc -c sqlite3.c % ls -l sqlite3.o -rw-r--r-- 1 dalke admin 1270372 Feb 6 04:11 sqlite3.o % gcc -c sqlite3.c -Os % ls -l sqlite3.o -rw-r--r-- 1 dalke admin 805044 Feb 6 04:12 sqlite3.o % clang -c sqlite3.c % ls -l sqlite3.o -rw-r--r-- 1 dalke admin 1248704 Feb 6 04:15 sqlite3.o % clang -c -Os sqlite3.c % ls -l sqlite3.o -rw-r--r-- 1 dalke admin 796888 Feb 6 04:16 sqlite3.o 778 KiB is still some 50% larger than 500.
- SQLite 11y agoUsing "gcc -Os -m32 -c sqlite3.c; size sqlite3.o" I get 443,264 bytes using the latest SQLite source on Ubuntu. The "size" command gives a more accurate measurement of what actually ends up in a compiled and stripped binary. "ls -l" includes symbolic and linking info that gets stripped from the finished binary.
- jevinskie 11y agoClang also has -Oz for even more aggressive size optimizations. I find that it is identical codegen to -Os half the time and shows some nice size reductions the other half of the time.
- coliveira 11y agoThis might have to do with 64 bit platforms. I would test this on a 32 bit binary.
- dang 11y agoWe should have a bonus for finding great old articles that never were posted to HN before. There was another one earlier today: https://news.ycombinator.com/item?id=11048637 https://news.ycombinator.com/item?id=11048637.
- bootload 11y agoyeah I'll take a look, @dang the web rusts a lot so a lot of old stuff might be archived [0] there. [0] Internet Archive https://archive.org/ https://archive.org/
- greglindahl 11y agoFor the future, HN's software could call the Wayback Machine's "save page now" API on all front-page links.
- dang 11y agoDefinitely willing to do that. Lord knows we do it enough by hand already.
- sehugg 11y agoSo how many SQLite databases are in use? "We don't have a good way of counting it," he says, "but we're guessing it's the most widely deployed SQL database in the world." This article came out before the original iPhone was released -- it certainly is by now, probably by an order of magnitude.
- skeeterbug 11y agoChrome uses it for local storage too right?
- infogulch 11y agoAnd Firefox. There are probably more instances of SQLite in use than humans on the planet.
- abtinf 11y agoJust "an order of magnitude"? I suspect you are off by an order of magnitude. If you count each deployed instance of each product using it, it's probably the most popular by close to 10 orders of magnitude. Edit: phones are just the start. Numerous embedded products use it - the kind that ship in such large quantities that a couple pennies per device become significant sums of money. And even in the phone case, every app is using a separate database.
- adrianN 11y ago10 orders of magnitude is a lot. Are you really saying there are ten billion times more SQLlite databases than the next most popular SQL?
- masklinn 11y agoThat's probably excessive by a lot, but every modern smartphone has at least one sqlite bundled (possibly more, some software will bundle their own in case the system changes its version), OSX bundles it (and Apple Mail uses it for some stuff), Chrome and Firefox bundle it, …
- ksec 11y agowhat happened to SQLite 4?
- maaku 11y agoThis is from 2007.
- smadge 11y agoHacker news is too often obsessed with get rich quick schemes, and devising new ways to rip people off. It's nice to hear a story about people who just wants to write good, useful software, and release it to the public domain.
- matt_wulfeck 11y ago> The author disclaims copyright to this source code. In place of a legal notice, here is a blessing: may you do good and not evil. May you find forgiveness for yourself and forgive others. May you share freely, never taking more than you give. Wow! That is the most enlightened disclaimer I've ever read.