Revision dae604a...

Go back to digest for 13th April 2014

Optimization in KDE-PIM

Dan Vratil committed changes in [akonadi] /src:

Enable concurrency in our copy of QSQLITE driver

The original patches that were implementing blocking versions of sqlite3_*
functions were simply using usleep() to wait before trying again in case the
function returned SQLITE_LOCKED. This patch removes use of usleep() and instead
uses SQLite's native unlock_notify API designed exactly for this purpose.

The new unlock_notify() code shows that calls block for ~80ms in average, which
is much less than 500ms that the usleep() code was expecting.

More importantly, this patch enables shared cache in SQLite, which enables
actual support for concurrency in SQLite and allows us to get rid of the global
mutex in DataStore that was serializing transactions, which results in notable
speed up of certain operations in Akonadi, most notable item synchronization,
because we are now able to actually sync multiple resources in parallel.

This is the first step needed for upstreaming our changes to Qt, but further
optimizations are possible.

We don't have any unit-tests or benchmarks for the driver atm (and the Qt ones
don't cover our needs), so we need to check carefully for possible regressions.
For that reason this goes to master, but can probably be backported to stable
if everything turns out to be OK.

File Changes

Modified 3 files
  • /src
  •   qsqlite/qsql_sqlite.cpp
  •   qsqlite/sqlite_blocking.cpp
  •   qsqlite/sqlite_blocking.h
3 files changed in total