On Aug 28, 2008, at 3:19 AM, [EMAIL PROTECTED] wrote:

>> Is there a performance hit assosiated with manifest typing?
>
> I'm not sure about performance, but I assume that static typing  
> might reduce memory usage (especially with small caches). Internally  
> every type in sqlite is stored in structure that takes 64 bytes  
> (little more on 64 bit systems). Different structure for every type  
> or even union would make the size smaller.
>


The structure that holds a variable in SQLite is 40 bytes on a 32-bit  
system and 56 bytes on 64-bit.  The number of such structures required  
for an SQLite statement depends on the complexity of the statement,  
but averages around 13.  Assuming the same structure in a rigidly  
typed system requires 8 bytes (the size of a 64-bit integer) then your  
total savings will be about 624 bytes on a 64-bit system - less on a  
32-bit system.  You can save more memory by reducing the size of your  
disk cache from 2000 to 1999 pages.

Note also that the extra code complexity required to support a rigid  
type system would likely swell the size of the library by several  
hundred kilobytes.  So you would be trading perhaps 250KB of code  
space for a heap space savings of less than 1KB.


D. Richard Hipp
[EMAIL PROTECTED]



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to