On Jul 25, 2008, at 10:50 PM, Dave Gierok wrote:

> Does anyone know what endianness a Sqlite database is stored in?   
> Or does that depend on the endianness of the machine it was created  
> on?  I am wondering because we ship a game that runs on Xbox 360,  
> which uses the PowerPC architecture and has a different endianness  
> than the PC.  We run PC tools to create our database for the game.   
> I wonder if we are paying a performance overhead on the Xbox if the  
> database essentially needs to be 'converted' runtime.

All the various integer values in sqlite are stored in big-endian
format. The way they are encoded/decoded, I don't think there will
be any difference at all between big and little-endian platforms.
And even if you tried to speed it up by taking advantage of a big-endian
processor, I don't think it would make much difference in the long
run.

If you are using utf-16 encoding for your database, SQLite lets you
choose between little and big-endian encoding. All text values in
the database are stored using the same encoding, which is set when
the database is created. It might be worth trying to make sure you
use the "native" utf-16 encoding for the target platform. Otherwise,
your calls to sqlite3_column_text16() will be just a little bit
slower.

See the docs for "pragma encoding" for details.

Dan.

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

Reply via email to