4 ms·
Also out of date. The 3.10.2 shared library is over 1 MiB on my system.
by nly 11y ago
Also 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.