[Kmymoney-devel] Review Request 115680: Performance optimization of the mymoney object container.

Christian David christian-david at web.de
Tue Feb 11 21:29:26 UTC 2014


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



kmymoney/mymoney/mymoneyobjectcontainer.cpp
<https://git.reviewboard.kde.org/r/115680/#comment34944>

    Only style: you can use qDeleteAll() for this ( http://qt-project.org/doc/qt-4.8/qtalgorithms.html#qDeleteAll-2 , map.clear() is still needed then)


- Christian David


On Feb. 11, 2014, 8:55 p.m., Cristian Oneț wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115680/
> -----------------------------------------------------------
> 
> (Updated Feb. 11, 2014, 8:55 p.m.)
> 
> 
> Review request for KMymoney and Thomas Baumgart.
> 
> 
> Repository: kmymoney
> 
> 
> Description
> -------
> 
> Performance optimization of the mymoney object container.
> 
> The MyMoneyObjectContainer::account(QString) was the most costly
> method of this class. Mainly due to the calls to dynamic_cast
> needed to obtain the cached MyMoneyObject with it's proper type.
> 
> Improved this by:
> 1. implementing a per object type cache.
> 2. using QHash instead of QMap which provides faster lookups
> 3. replace macro method implementation with template methods
> 
> Thomas again I need your blessing for this :). I removed all method implementations by macros even though I have to admit that the file would be shorter using macros.
> 
> 
> Diffs
> -----
> 
>   kmymoney/mymoney/mymoneyobjectcontainer.h 2abc0f06632b4c29f6443ab3ad66cccf6a4ce1d9 
>   kmymoney/mymoney/mymoneyobjectcontainer.cpp 796d9aa8cb44de5a449bb54f1a46e313ff65cf0d 
> 
> Diff: https://git.reviewboard.kde.org/r/115680/diff/
> 
> 
> Testing
> -------
> 
> Ran unit test. Profiled application and observed a performance improvement.
> 
> 
> File Attachments
> ----------------
> 
> File load before optimization
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/5a184cd9-42d1-4bbf-9fc2-0709b0987d14__file-load-before.png
> File load after optimization
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/4b430712-a66e-410c-9a1a-15f990370043__file-load-after.png
> Register load before optimization
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/eaa62d0b-1035-481e-a947-fac60fd6f388__register-load-before.png
> Register load after optimization
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/02/11/55f57547-1b6b-436e-bd23-89c43da23be8__register-load-after.png
> 
> 
> Thanks,
> 
> Cristian Oneț
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20140211/938f69e3/attachment.html>


More information about the KMyMoney-devel mailing list