[Kde-pim] Review Request 121247: Optimize: Reduce the amount of allocations required to build a query.

Milian Wolff mail at milianw.de
Tue Nov 25 19:27:38 GMT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121247/
-----------------------------------------------------------

Review request for Akonadi, Daniel Vrátil and Volker Krause.


Repository: akonadi


Description
-------

The initial implementation of the QueryBuilder was quite naive, when
you look at the amount of string allocations it does to build the
final query we sent to the SQL server.

This was found with Linux perf (no, not even heaptrack!). It
showed a huge number of cycles spent in malloc/free, all called
eventually by the QueryBuilder.

This patch removes most of these allocations. It can further be
improved in the future, I bet. Also, the amount of queries we create
is pretty large. I guess using stored procedures or something similar
might also help the performance. At least, we should try to "remember"
some of our queries, and make it possible to reuse them in the
functions that run often.


Diffs
-----

  server/src/storage/querybuilder.h b380f93d8153ebf4581d24da9c820fd0b7b81701 
  server/src/storage/querybuilder.cpp c07905906bdc712d41007ada753c2d821afd0a2d 
  server/tests/unittest/querybuildertest.cpp 0aba8a17ad7fb5c35f4b2b3e4366d11061b5329d 

Diff: https://git.reviewboard.kde.org/r/121247/diff/


Testing
-------

querybuilder test runs, KMail runs - no errors shown on the CLI.


Thanks,

Milian Wolff

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list