Documentation Source Text

Artifact Content
Login

Artifact a8dc49b13ddeb47a418802002b0b14a1a1e53965:


<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>