4 ms·
A 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 aim
by dalke 11y ago
A 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.