sql-js / sql.js

A javascript library to run SQLite on the web.
http://sql.js.org
Other
12.77k stars 1.06k forks source link

Compile sql.js with the right options #75

Open lovasoa opened 9 years ago

lovasoa commented 9 years ago

Not all SQLite functionalities are used in sql.js. We should compile it with the right options, in order to provide a smaller sql.js file at the end.

lovasoa commented 9 years ago

Progress:

Size of sql.js, in bytes

All the results are cumulative. The size indicated on the nth line is the one of sql.js compiled with all the nth first compile flags.

Compile flag size Notes
NONE 1 605 772
-DSQLITE_OMIT_ATTACH 1 601 928
-DSQLITE_OMIT_BUILTIN_TEST 1 600 197
-DSQLITE_OMIT_DEPRECATED 1 599 530
-DSQLITE_OMIT_WAL 1 535 226 tests fail
-DSQLITE_OMIT_EXPLAIN 1 512 027
-DSQLITE_OMIT_UTF16 1 502 866
-DSQLITE_OMIT_AUTHORIZATION 1 495 415