Pages

Monday, January 16, 2017

QSqlQuery vs. SOCI: inserting 1000 times

Recently I'm using QtWebApp to develop an application, and I did some performance benchmark to select a database library in the backend.  I selected QSqlQuery and SOCI as candidates, and tried to insert 10,000 rows at once. The result is as follows:

  • Repeating single query
    • QSqlQuery: 10000ms
    • SOCI: 2500ms
  • Prepared statement
    •  QSqlQuery: 7000ms
    • SOCI: 750ms(?!)
In any situation, SOCI takes far less time than QSqlQuery. QSqlQuery seems to be really a bad choice for server applications. I suspect the bottleneck is the loooooong processing time for QString.

No comments:

Post a Comment