2013. október 21., hétfő

Sqlite vs. portable Boost serialization storage

I have been using sqlite storage in my hobby robotics research project to storage some basic information about the transfered data from AIBO via network. It was really lightweight, some tables and I was committed to use this solution because it is easy to browse a standard Sqlite database and analyze the content. However, I have switched to serialized archives from Boost today, especially a portable archive implementation (http://epa.codeplex.com/). I had some performance testing earlier and the portable archive is 2-3x slower compared to ordinary Boost binary archives, but it is portable. I have simulated a longer session with AIBO on my laptop, restricted to the lowest CPU frequency.

The sqlite performance:
Writing database: ~25000 msec
Reading database: ~2400 msec

The exactly same portable binary archive:
Writing archive: ~200 msec
Reading archive: ~300 msec

Reading is ~8 times faster and writing ~125 times faster with portable boost archives (boost) than sqlite. I have to emphasize that the database is very simple with a few tables and relations are not used in the queries.