Documentation Source Text
Check-in [4cf26f]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add reports on the effect of compile-time options on library footprint.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4cf26f38116e246ee0e8e08da4dd006e004ffac7
User & Date: drh 2011-10-19 22:32:18
Context
2011-10-20
16:34
Update the link to Intuit on the famous.html page. check-in: 1c732d user: drh tags: trunk
2011-10-19
22:32
Add reports on the effect of compile-time options on library footprint. check-in: 4cf26f user: drh tags: trunk
19:51
Tweaks to the changes.html page. check-in: 7e0c74 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/compile.in.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
519
520
521
522
523
524
525
526

527
528
529
530
531
532
533
534
<h1>1.0 Compilation Options For SQLite</h1>

<p>
For most purposes, SQLite can be built just fine using the default
compilation options. However, if required, the compile-time options
documented below can be used to 
<a href="#omitfeatures">omit SQLite features</a> (resulting in
a smaller compiled library size) or to change the
<a href="#defaults">default values</a> of some parameters.
</p>

<p>
Every effort has been made to ensure that the various combinations
of compilation options work harmoniously and produce a working library.
Nevertheless, it is strongly recommended that the SQLite test-suite
................................................................................

<tcl>
  hd_fragment "omitfeatures"
  hd_keywords "omitfeatures"
</tcl>
<h2>1.6 Options To Omit Features</h2>

<p>The following options can used to reduce the size of the compiled

library by omitting optional features. This is probably only useful
in embedded systems where space is especially tight, as even with all
features included the SQLite library is relatively small. Don't forget
to tell your compiler to optimize for binary size! (the -Os option if
using GCC).  Telling your compiler to optimize for size usually has
a much larger impact on library footprint than employing any of these
compile-time options.  You should also verify that 
<a href="#debugoptions">debugging options</a> are disabled.</p>







|







 







|
>
|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
<h1>1.0 Compilation Options For SQLite</h1>

<p>
For most purposes, SQLite can be built just fine using the default
compilation options. However, if required, the compile-time options
documented below can be used to 
<a href="#omitfeatures">omit SQLite features</a> (resulting in
a [relfootprint | smaller compiled library size]) or to change the
<a href="#defaults">default values</a> of some parameters.
</p>

<p>
Every effort has been made to ensure that the various combinations
of compilation options work harmoniously and produce a working library.
Nevertheless, it is strongly recommended that the SQLite test-suite
................................................................................

<tcl>
  hd_fragment "omitfeatures"
  hd_keywords "omitfeatures"
</tcl>
<h2>1.6 Options To Omit Features</h2>

<p>The following options can used to 
[relfootprint | reduce the size of the compiled library]
by omitting unused features. This is probably only useful
in embedded systems where space is especially tight, as even with all
features included the SQLite library is relatively small. Don't forget
to tell your compiler to optimize for binary size! (the -Os option if
using GCC).  Telling your compiler to optimize for size usually has
a much larger impact on library footprint than employing any of these
compile-time options.  You should also verify that 
<a href="#debugoptions">debugging options</a> are disabled.</p>

Changes to pages/footprint.in.

139
140
141
142
143
144
145







































































































































































































































































































































































































































































































































<tr>
<td align="center"> -O3
<td align="right">661622
<td align="center">0.55

</table>













































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663

<tr>
<td align="center"> -O3
<td align="right">661622
<td align="center">0.55

</table>

<hr>
<tcl>hd_fragment relfootprint relfootprint</tcl>


<h2 align="center">The Effect Of Compile-Time Options On Library Size</h2>

<p>The next study shows the effect that various [compile-time options] for
SQLite have on the size of the resulting library file.  The following 
size figures are computed with an early beta of SQLite version 3.7.9
using GCC version 4.6.1 for X86_64 running on Ubuntu with the -Os option.
Actual sizes and size differences may vary by compiler and system.</p>

<table border="1" cellpadding=4 cellspacing=0>
<tr>
<th valign="bottom">[compile-time options | Compile-Time Option]</th>
<th valign="bottom">Library<br>Footprint</th>
<th valign="bottom">Difference<br>From<br>Baseline</th>
<th valign="bottom">Percentage<br>Difference</th>
</tr>

<tr>
<td>All OMIT options</td>
<td align="right">248363</td>
<td align="right">-155714</td>
<td align="right">-38.536%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_TRIGGER]</td>
<td align="right">382038</td>
<td align="right">-22039</td>
<td align="right"> -5.454%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_WAL]</td>
<td align="right">388281</td>
<td align="right">-15796</td>
<td align="right"> -3.909%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_FLOATING_POINT]</td>
<td align="right">390469</td>
<td align="right">-13608</td>
<td align="right"> -3.368%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_VIRTUALTABLE]</td>
<td align="right">391156</td>
<td align="right">-12921</td>
<td align="right"> -3.198%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_PRAGMA]</td>
<td align="right">391292</td>
<td align="right">-12785</td>
<td align="right"> -3.164%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_FOREIGN_KEY]</td>
<td align="right">393555</td>
<td align="right">-10522</td>
<td align="right"> -2.604%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTOVACUUM]</td>
<td align="right">395589</td>
<td align="right">-8488</td>
<td align="right"> -2.101%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_SUBQUERY]</td>
<td align="right">396313</td>
<td align="right">-7764</td>
<td align="right"> -1.921%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_COMPOUND_SELECT]</td>
<td align="right">396810</td>
<td align="right">-7267</td>
<td align="right"> -1.798%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_EXPLAIN]</td>
<td align="right">397011</td>
<td align="right">-7066</td>
<td align="right"> -1.749%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_DATETIME_FUNCS]</td>
<td align="right">397179</td>
<td align="right">-6898</td>
<td align="right"> -1.707%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_INTEGRITY_CHECK]</td>
<td align="right">397438</td>
<td align="right">-6639</td>
<td align="right"> -1.643%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_ATTACH]</td>
<td align="right">397951</td>
<td align="right">-6126</td>
<td align="right"> -1.516%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_ALTERTABLE]</td>
<td align="right">398344</td>
<td align="right">-5733</td>
<td align="right"> -1.419%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_UTF16]</td>
<td align="right">399069</td>
<td align="right">-5008</td>
<td align="right"> -1.239%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_SHARED_CACHE]</td>
<td align="right">399249</td>
<td align="right">-4828</td>
<td align="right"> -1.195%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_INCRBLOB]</td>
<td align="right">399889</td>
<td align="right">-4188</td>
<td align="right"> -1.036%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_ANALYZE]</td>
<td align="right">400207</td>
<td align="right">-3870</td>
<td align="right"> -0.958%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTHORIZATION]</td>
<td align="right">401002</td>
<td align="right">-3075</td>
<td align="right"> -0.761%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_VACUUM]</td>
<td align="right">401026</td>
<td align="right">-3051</td>
<td align="right"> -0.755%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_PAGER_PRAGMAS]</td>
<td align="right">401168</td>
<td align="right">-2909</td>
<td align="right"> -0.720%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_OR_OPTIMIZATION]</td>
<td align="right">401374</td>
<td align="right">-2703</td>
<td align="right"> -0.669%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_VIEW]</td>
<td align="right">401500</td>
<td align="right">-2577</td>
<td align="right"> -0.638%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_BUILTIN_TEST]</td>
<td align="right">401711</td>
<td align="right">-2366</td>
<td align="right"> -0.586%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_XFER_OPT]</td>
<td align="right">402052</td>
<td align="right">-2025</td>
<td align="right"> -0.501%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTOINCREMENT]</td>
<td align="right">402098</td>
<td align="right">-1979</td>
<td align="right"> -0.490%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_SCHEMA_PRAGMAS]</td>
<td align="right">402312</td>
<td align="right">-1765</td>
<td align="right"> -0.437%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_TRACE]</td>
<td align="right">402369</td>
<td align="right">-1708</td>
<td align="right"> -0.423%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_LOAD_EXTENSION]</td>
<td align="right">402611</td>
<td align="right">-1466</td>
<td align="right"> -0.363%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTOMATIC_INDEX]</td>
<td align="right">402685</td>
<td align="right">-1392</td>
<td align="right"> -0.344%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_LIKE_OPTIMIZATION]</td>
<td align="right">402928</td>
<td align="right">-1149</td>
<td align="right"> -0.284%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_REINDEX]</td>
<td align="right">402975</td>
<td align="right">-1102</td>
<td align="right"> -0.273%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_GET_TABLE]</td>
<td align="right">402999</td>
<td align="right">-1078</td>
<td align="right"> -0.267%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_COMPLETE]</td>
<td align="right">403135</td>
<td align="right">-942</td>
<td align="right"> -0.233%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_TEMPDB]</td>
<td align="right">403200</td>
<td align="right">-877</td>
<td align="right"> -0.217%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_BTREECOUNT]</td>
<td align="right">403301</td>
<td align="right">-776</td>
<td align="right"> -0.192%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_LOCALTIME]</td>
<td align="right">403307</td>
<td align="right">-770</td>
<td align="right"> -0.191%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_COMPILEOPTION_DIAGS]</td>
<td align="right">403309</td>
<td align="right">-768</td>
<td align="right"> -0.190%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_FLAG_PRAGMAS]</td>
<td align="right">403441</td>
<td align="right">-636</td>
<td align="right"> -0.157%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_QUICKBALANCE]</td>
<td align="right">403455</td>
<td align="right">-622</td>
<td align="right"> -0.154%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_CAST]</td>
<td align="right">403457</td>
<td align="right">-620</td>
<td align="right"> -0.153%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_CHECK]</td>
<td align="right">403501</td>
<td align="right">-576</td>
<td align="right"> -0.143%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_MEMORYDB]</td>
<td align="right">403555</td>
<td align="right">-522</td>
<td align="right"> -0.129%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_BLOB_LITERAL]</td>
<td align="right">403619</td>
<td align="right">-458</td>
<td align="right"> -0.113%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS]</td>
<td align="right">403748</td>
<td align="right">-329</td>
<td align="right"> -0.081%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_LOOKASIDE]</td>
<td align="right">403753</td>
<td align="right">-324</td>
<td align="right"> -0.080%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTOINIT]</td>
<td align="right">403759</td>
<td align="right">-318</td>
<td align="right"> -0.079%</td>
</tr>

<tr>
<td>[SQLITE_DISABLE_DIRSYNC]</td>
<td align="right">403782</td>
<td align="right">-295</td>
<td align="right"> -0.073%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_DECLTYPE]</td>
<td align="right">403794</td>
<td align="right">-283</td>
<td align="right"> -0.070%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_DEPRECATED]</td>
<td align="right">403794</td>
<td align="right">-283</td>
<td align="right"> -0.070%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_BETWEEN_OPTIMIZATION]</td>
<td align="right">403929</td>
<td align="right">-148</td>
<td align="right"> -0.037%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_PROGRESS_CALLBACK]</td>
<td align="right">403957</td>
<td align="right">-120</td>
<td align="right"> -0.030%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_TRUNCATE_OPTIMIZATION]</td>
<td align="right">403984</td>
<td align="right">-93</td>
<td align="right"> -0.023%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_TCL_VARIABLE]</td>
<td align="right">404003</td>
<td align="right">-74</td>
<td align="right"> -0.018%</td>
</tr>

<tr>
<td>Baseline SQLite Library Size</td>
<td align="right">404077</td>
<td align="right">0</td>
<td align="right"> 0.000%</td>
</tr>

<tr>
<td>[SQLITE_DISABLE_LFS]</td>
<td align="right">404105</td>
<td align="right">+28</td>
<td align="right"> +0.007%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_IOTRACE]</td>
<td align="right">404108</td>
<td align="right">+31</td>
<td align="right"> +0.008%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_AUTORESET]</td>
<td align="right">404143</td>
<td align="right">+66</td>
<td align="right"> +0.016%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_MEMORY_MANAGEMENT]</td>
<td align="right">404348</td>
<td align="right">+271</td>
<td align="right"> +0.067%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_UPDATE_DELETE_LIMIT]</td>
<td align="right">404780</td>
<td align="right">+703</td>
<td align="right"> +0.174%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_COLUMN_METADATA]</td>
<td align="right">405198</td>
<td align="right">+1121</td>
<td align="right"> +0.277%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_UNLOCK_NOTIFY]</td>
<td align="right">405371</td>
<td align="right">+1294</td>
<td align="right"> +0.320%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_ATOMIC_WRITE]</td>
<td align="right">405426</td>
<td align="right">+1349</td>
<td align="right"> +0.334%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_MEMSYS5]</td>
<td align="right">406290</td>
<td align="right">+2213</td>
<td align="right"> +0.548%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_MEMSYS3]</td>
<td align="right">406927</td>
<td align="right">+2850</td>
<td align="right"> +0.705%</td>
</tr>

<tr>
<td>[SQLITE_OMIT_WSD]</td>
<td align="right">408536</td>
<td align="right">+4459</td>
<td align="right"> +1.104%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_STAT3]</td>
<td align="right">410352</td>
<td align="right">+6275</td>
<td align="right"> +1.553%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_RTREE]</td>
<td align="right">422554</td>
<td align="right">+18477</td>
<td align="right"> +4.573%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_FTS3]</td>
<td align="right">467173</td>
<td align="right">+63096</td>
<td align="right">+15.615%</td>
</tr>

<tr>
<td>[SQLITE_ENABLE_FTS4]</td>
<td align="right">467185</td>
<td align="right">+63108</td>
<td align="right">+15.618%</td>
</tr>
</table>