KConfig SQL backend

Ivan Vasin nisavid at gmail.com
Thu Jul 24 22:48:11 BST 2008


I rewrote some of the mysql backend, cutting out the parts that
convert everything to printable strings (since mysql can store in
utf8) and converting it from using direct access via QSqlDatabase to
using cached access via QSqlTableModel. These changes improved the
backend's performance by at least a factor of two in all of the tests
I ran. This new version is attached.

> 1) SQL with a good engine can be faster than flat files.

With the MyISAM engine using mysql-5.0.60 in Gentoo Linux on a 1.86GHz
Pentium M, I recorded the following figures:

Data in 276 groups, nearly all 3 layers deep, ~21 entries each.

read:
KConfigIniBackend 364 ms
KConfigMysqlBackend 217 ms

write:
KConfigIniBackend 4638 ms
KConfigMysqlBackend 9904 ms

All figures are averages of 4 samples each.

As you can see, the mysql backend performs slightly better on reads,
and is about twice as slow on writes, compared to the ini backend.
This is with the "batched mode" parse/write that KConfig currently
uses. It would be interesting to compare their performance with an
"on-demand mode" parse/write.

> if you are interested in serious kconfig work i have a nice todo list
> and some half-finished code for you. a word of warning: kconfig
> developers have a tendency to disappear without a trace (two and
> counting).

I am interested, but I won't have much time to commit to it before the
end of August. Also unless I missed something in the API docs, here is
another item for that todo list: making KSharedConfig support
different backends.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfigmysql.tar.bz2
Type: application/x-bzip2
Size: 11226 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080724/b965d339/attachment.bin>
-------------- next part --------------
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


More information about the kde-core-devel mailing list