[odb-users] Network speed issue

Boris Kolpackov boris at codesynthesis.com
Sun Sep 17 13:06:17 EDT 2017


Hi Gilles,

Gilles Bene <gilles.benepougoue at gmail.com> writes:

> I notice that the data transfert speed is maximum 50KiB/s, average is
> 22KiB/s. Which is very slow. When I access the data base directly with Qt
> SQL database support
> 
> (QSqlDatabase db =  QSqlDatabase::addDatabase("QPSQL"); ...) ,
> 
> the speed is on average 5MiB/s and the app performs very well.

My guess would be you are doing things differently in the ODB and
Qt versions of your application. Specifically, things like creating
a connection or starting a transaction all have costs. So make sure
that you don't do any of these unnecessarily. Specifically, I would
suggest that:

1. You create a single instance of odb::database for the lifetime
   of your application.

2. Batch as many database operations into a single transaction as
   reasonable since every transaction begin/commit is a network
   roundtrip.

Boris



More information about the odb-users mailing list