Documentation Source Text
Check-in [c3a816]
Not logged in

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

Overview
Comment:Add the new database footprint page and populate it with statistics for SQLite version 3.7.8.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c3a816983ff9f30ea7ae291f5faafb832480d8c3
User & Date: drh 2011-09-19 15:42:12
Context
2011-09-19
16:41
Update compile.html with SQLITE_MAX_SCHEMA_RETRY and SQLITE_OMIT_MERGE_SORT. check-in: 555740 user: drh tags: trunk
15:42
Add the new database footprint page and populate it with statistics for SQLite version 3.7.8. check-in: c3a816 user: drh tags: trunk
2011-09-17
22:45
Update the testing statistics. check-in: 81fd8f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/about.in.

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
architectures.  These features make SQLite a popular choice as
an <a href="whentouse.html#appfileformat">Application File Format</a>.
Think of SQLite not as a replacement for 
[http://www.oracle.com/database/index.html|Oracle] but
as a replacement for [http://man.he.net/man3/fopen|fopen()]</p>

<p>SQLite is a compact library.
With all features enabled, the library size can be less than 350KiB,
depending on the target platform and compiler optimization settings.
(64-bit code is larger.  And some compiler optimizations
such as aggressive function inlining and loop unrolling can cause the
object code to be much larger.)  If optional features are omitted, the
size of the SQLite library can be reduced below 200KiB.  SQLite can also
be made to run in minimal stack space (4KiB) and
very little heap (100KiB), making SQLite a popular database engine 







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
architectures.  These features make SQLite a popular choice as
an <a href="whentouse.html#appfileformat">Application File Format</a>.
Think of SQLite not as a replacement for 
[http://www.oracle.com/database/index.html|Oracle] but
as a replacement for [http://man.he.net/man3/fopen|fopen()]</p>

<p>SQLite is a compact library.
With all features enabled, the [library size] can be less than 350KiB,
depending on the target platform and compiler optimization settings.
(64-bit code is larger.  And some compiler optimizations
such as aggressive function inlining and loop unrolling can cause the
object code to be much larger.)  If optional features are omitted, the
size of the SQLite library can be reduced below 200KiB.  SQLite can also
be made to run in minimal stack space (4KiB) and
very little heap (100KiB), making SQLite a popular database engine 

Changes to pages/different.in.

91
92
93
94
95
96
97

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  Most other SQL database engines require you to dump and restore
  the database when moving from one platform to another and often
  when upgrading to a newer version of the software.
}

feature small {Compact} {
  When optimized for size, the whole SQLite library with everything enabled

  is less than 275KiB in size (as measured on an ix86 using the "size"
  utility from the GNU compiler suite.)  Unneeded features can be disabled
  at compile-time to further reduce the size of the library to under
  190KiB if desired.
  <p>
  Most other SQL database engines are much larger than this.  IBM boasts
  that its recently released CloudScape database engine is "only" a 2MiB
  jar file - an order of magnitude larger than SQLite even after it is
  compressed!
  Firebird boasts that its client-side library is only 350KiB.  That's
  50% larger than SQLite and does not even contain the database engine.
  The Berkeley DB library from Oracle is 450KiB and it omits SQL
  support, providing the programmer with only simple key/value pairs.
}

feature typing {Manifest typing} {
  Most SQL database engines use static typing.  A datatype is associated
  with each column in a table and only values of that particular datatype







>
|









|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  Most other SQL database engines require you to dump and restore
  the database when moving from one platform to another and often
  when upgrading to a newer version of the software.
}

feature small {Compact} {
  When optimized for size, the whole SQLite library with everything enabled
  is [footprint | less than 350KiB in size]
  (as measured on an ix86 using the "size"
  utility from the GNU compiler suite.)  Unneeded features can be disabled
  at compile-time to further reduce the size of the library to under
  190KiB if desired.
  <p>
  Most other SQL database engines are much larger than this.  IBM boasts
  that its recently released CloudScape database engine is "only" a 2MiB
  jar file - an order of magnitude larger than SQLite even after it is
  compressed!
  Firebird boasts that its client-side library is only 350KiB.  That's
  as big as SQLite and does not even contain the database engine.
  The Berkeley DB library from Oracle is 450KiB and it omits SQL
  support, providing the programmer with only simple key/value pairs.
}

feature typing {Manifest typing} {
  Most SQL database engines use static typing.  A datatype is associated
  with each column in a table and only values of that particular datatype

Changes to pages/features.in.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
     - no setup or administration needed.</li>
<li>Implements most of SQL92.
    (<a href="omitted.html">Features not supported</a>)</li>
<li>A complete database is stored in a 
    <a href="onefile.html">single cross-platform disk file</a>.</li>
<li>Supports terabyte-sized databases and gigabyte-sized strings
    and blobs.  (See <a href="limits.html">limits.html</a>.)
<li>Small code footprint: 
    <a href="http://www.sqlite.org/cvstrac/wiki?p=SizeOfSqlite">
    less than 350KiB</a> fully configured or less
    than 200KiB with optional features omitted.</li>
<li><a href="speed.html">Faster</a> than popular client/server database
    engines for most common operations.</li>
<li>Simple, easy to use <a href="c3ref/intro.html">API</a>.</li>
<li>Written in ANSI-C.  <a href="tclsqlite.html">TCL bindings</a> included.
    Bindings for dozens of other languages 
    <a href="http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers">







|
<
|







10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
     - no setup or administration needed.</li>
<li>Implements most of SQL92.
    (<a href="omitted.html">Features not supported</a>)</li>
<li>A complete database is stored in a 
    <a href="onefile.html">single cross-platform disk file</a>.</li>
<li>Supports terabyte-sized databases and gigabyte-sized strings
    and blobs.  (See <a href="limits.html">limits.html</a>.)
<li>Small code [footprint]: 

    less than 350KiB fully configured or less
    than 200KiB with optional features omitted.</li>
<li><a href="speed.html">Faster</a> than popular client/server database
    engines for most common operations.</li>
<li>Simple, easy to use <a href="c3ref/intro.html">API</a>.</li>
<li>Written in ANSI-C.  <a href="tclsqlite.html">TCL bindings</a> included.
    Bindings for dozens of other languages 
    <a href="http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers">

Added pages/footprint.in.



































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<title>SQLite Library Footprint</title>
<tcl>hd_keywords footprint {library size}</tcl>


<h2 align="center">Size Of The SQLite Library</h2>

<p>
The code space used by the SQLite library depends heavily on 
the target platform, what
compiler and optimization options are used to generate object code,
and which optional features of SQLite are included or omitted from
the build.
This page provides examples of what to expect.
</p>

<p>
SQLite version 3.7.8 is less than 350KiB in size on x86 with -Os and
less than 400KiB (409KB) on x64.
The -O2 and -O3 builds are larger, presumably due to loop 
unrolling and function inlining.
</p>

<hr>
<h3>Case 1</h3>

<p><ul>
<li> SuSE Linux 10.1
<li> GCC 4.1.0
<li> SQLite version 3.7.8
<li> x86 (32-bit)
</ul></p>

<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)

<tr>
<td align="center"> -O0
<td align="right">529765
<td align="center">1.00

<tr>
<td align="center"> -O1
<td align="right">397204
<td align="center">0.71

<tr>
<td align="center"> -Os
<td align="right">333059
<td align="center">0.73

<tr>
<td align="center"> -O2
<td align="right">418161
<td align="center">0.68

<tr>
<td align="center"> -O3
<td align="right">828602
<td align="center">0.66

</table>

<hr>
<h3>Case 2</h3>

<p><ul>
<li> Ubuntu
<li> GCC 4.5.2
<li> SQLite version 3.7.8
<li> x86_64 (64-bit)
</ul></p>

<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)

<tr>
<td align="center"> -O0
<td align="right">625841
<td align="center">1.00

<tr>
<td align="center"> -O1
<td align="right">455072
<td align="center">0.62

<tr>
<td align="center"> -Os
<td align="right">404201
<td align="center">0.59

<tr>
<td align="center"> -O2
<td align="right">499543
<td align="center">0.53

<tr>
<td align="center"> -O3
<td align="right">678465
<td align="center">0.54

</table>


<hr>
<h3>Case 3</h3>

<p><ul>
<li> Mac OS 10.7.1 (Lion)
<li> GCC 4.2.1 + LLVM
<li> SQLite version 3.7.8
<li> x86_64 (64-bit)
</ul></p>

<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)

<tr>
<td align="center"> -O0
<td align="right">806598
<td align="center">1.00

<tr>
<td align="center"> -O1
<td align="right">508500
<td align="center">0.61

<tr>
<td align="center"> -Os
<td align="right">481816
<td align="center">0.57

<tr>
<td align="center"> -O2
<td align="right">614346
<td align="center">0.55

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

</table>