Documentation Source Text

Check-in [c3a816983f]
Login

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: 5557403d9c 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: c3a816983f user: drh tags: trunk
2011-09-17
22:45
Update the testing statistics. check-in: 81fd8fc44f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to pages/about.in.

    55     55   architectures.  These features make SQLite a popular choice as
    56     56   an <a href="whentouse.html#appfileformat">Application File Format</a>.
    57     57   Think of SQLite not as a replacement for 
    58     58   [http://www.oracle.com/database/index.html|Oracle] but
    59     59   as a replacement for [http://man.he.net/man3/fopen|fopen()]</p>
    60     60   
    61     61   <p>SQLite is a compact library.
    62         -With all features enabled, the library size can be less than 350KiB,
           62  +With all features enabled, the [library size] can be less than 350KiB,
    63     63   depending on the target platform and compiler optimization settings.
    64     64   (64-bit code is larger.  And some compiler optimizations
    65     65   such as aggressive function inlining and loop unrolling can cause the
    66     66   object code to be much larger.)  If optional features are omitted, the
    67     67   size of the SQLite library can be reduced below 200KiB.  SQLite can also
    68     68   be made to run in minimal stack space (4KiB) and
    69     69   very little heap (100KiB), making SQLite a popular database engine 

Changes to pages/different.in.

    91     91     Most other SQL database engines require you to dump and restore
    92     92     the database when moving from one platform to another and often
    93     93     when upgrading to a newer version of the software.
    94     94   }
    95     95   
    96     96   feature small {Compact} {
    97     97     When optimized for size, the whole SQLite library with everything enabled
    98         -  is less than 275KiB in size (as measured on an ix86 using the "size"
           98  +  is [footprint | less than 350KiB in size]
           99  +  (as measured on an ix86 using the "size"
    99    100     utility from the GNU compiler suite.)  Unneeded features can be disabled
   100    101     at compile-time to further reduce the size of the library to under
   101    102     190KiB if desired.
   102    103     <p>
   103    104     Most other SQL database engines are much larger than this.  IBM boasts
   104    105     that its recently released CloudScape database engine is "only" a 2MiB
   105    106     jar file - an order of magnitude larger than SQLite even after it is
   106    107     compressed!
   107    108     Firebird boasts that its client-side library is only 350KiB.  That's
   108         -  50% larger than SQLite and does not even contain the database engine.
          109  +  as big as SQLite and does not even contain the database engine.
   109    110     The Berkeley DB library from Oracle is 450KiB and it omits SQL
   110    111     support, providing the programmer with only simple key/value pairs.
   111    112   }
   112    113   
   113    114   feature typing {Manifest typing} {
   114    115     Most SQL database engines use static typing.  A datatype is associated
   115    116     with each column in a table and only values of that particular datatype

Changes to pages/features.in.

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

Added pages/footprint.in.

            1  +<title>SQLite Library Footprint</title>
            2  +<tcl>hd_keywords footprint {library size}</tcl>
            3  +
            4  +
            5  +<h2 align="center">Size Of The SQLite Library</h2>
            6  +
            7  +<p>
            8  +The code space used by the SQLite library depends heavily on 
            9  +the target platform, what
           10  +compiler and optimization options are used to generate object code,
           11  +and which optional features of SQLite are included or omitted from
           12  +the build.
           13  +This page provides examples of what to expect.
           14  +</p>
           15  +
           16  +<p>
           17  +SQLite version 3.7.8 is less than 350KiB in size on x86 with -Os and
           18  +less than 400KiB (409KB) on x64.
           19  +The -O2 and -O3 builds are larger, presumably due to loop 
           20  +unrolling and function inlining.
           21  +</p>
           22  +
           23  +<hr>
           24  +<h3>Case 1</h3>
           25  +
           26  +<p><ul>
           27  +<li> SuSE Linux 10.1
           28  +<li> GCC 4.1.0
           29  +<li> SQLite version 3.7.8
           30  +<li> x86 (32-bit)
           31  +</ul></p>
           32  +
           33  +<table border="1" cellpadding="5" cellspacing="0">
           34  +<tr>
           35  +<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)
           36  +
           37  +<tr>
           38  +<td align="center"> -O0
           39  +<td align="right">529765
           40  +<td align="center">1.00
           41  +
           42  +<tr>
           43  +<td align="center"> -O1
           44  +<td align="right">397204
           45  +<td align="center">0.71
           46  +
           47  +<tr>
           48  +<td align="center"> -Os
           49  +<td align="right">333059
           50  +<td align="center">0.73
           51  +
           52  +<tr>
           53  +<td align="center"> -O2
           54  +<td align="right">418161
           55  +<td align="center">0.68
           56  +
           57  +<tr>
           58  +<td align="center"> -O3
           59  +<td align="right">828602
           60  +<td align="center">0.66
           61  +
           62  +</table>
           63  +
           64  +<hr>
           65  +<h3>Case 2</h3>
           66  +
           67  +<p><ul>
           68  +<li> Ubuntu
           69  +<li> GCC 4.5.2
           70  +<li> SQLite version 3.7.8
           71  +<li> x86_64 (64-bit)
           72  +</ul></p>
           73  +
           74  +<table border="1" cellpadding="5" cellspacing="0">
           75  +<tr>
           76  +<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)
           77  +
           78  +<tr>
           79  +<td align="center"> -O0
           80  +<td align="right">625841
           81  +<td align="center">1.00
           82  +
           83  +<tr>
           84  +<td align="center"> -O1
           85  +<td align="right">455072
           86  +<td align="center">0.62
           87  +
           88  +<tr>
           89  +<td align="center"> -Os
           90  +<td align="right">404201
           91  +<td align="center">0.59
           92  +
           93  +<tr>
           94  +<td align="center"> -O2
           95  +<td align="right">499543
           96  +<td align="center">0.53
           97  +
           98  +<tr>
           99  +<td align="center"> -O3
          100  +<td align="right">678465
          101  +<td align="center">0.54
          102  +
          103  +</table>
          104  +
          105  +
          106  +<hr>
          107  +<h3>Case 3</h3>
          108  +
          109  +<p><ul>
          110  +<li> Mac OS 10.7.1 (Lion)
          111  +<li> GCC 4.2.1 + LLVM
          112  +<li> SQLite version 3.7.8
          113  +<li> x86_64 (64-bit)
          114  +</ul></p>
          115  +
          116  +<table border="1" cellpadding="5" cellspacing="0">
          117  +<tr>
          118  +<th>Optimization<br>Setting<th>Size<br>(bytes)<th>Run-time<br>(Relative to -O0)
          119  +
          120  +<tr>
          121  +<td align="center"> -O0
          122  +<td align="right">806598
          123  +<td align="center">1.00
          124  +
          125  +<tr>
          126  +<td align="center"> -O1
          127  +<td align="right">508500
          128  +<td align="center">0.61
          129  +
          130  +<tr>
          131  +<td align="center"> -Os
          132  +<td align="right">481816
          133  +<td align="center">0.57
          134  +
          135  +<tr>
          136  +<td align="center"> -O2
          137  +<td align="right">614346
          138  +<td align="center">0.55
          139  +
          140  +<tr>
          141  +<td align="center"> -O3
          142  +<td align="right">661622
          143  +<td align="center">0.55
          144  +
          145  +</table>