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

Review request for KMymoney and Thomas Baumgart.


Repository: alkimia


Description
-------

Before this the biggest cost of using an AlkValue object, implicitly a 
KMyMoneyMoney object was assignment, construction and destruction.

By using implicit sharing combined with a shared zero value, copying on 
assignment and construction can be greatly reduced.

Implicit sharing was easy to implement using QSharedDataPointer.

Bumped the library version because API changes were necessary. The mpq_class 
&valueRef() const method was bad beacause it was returning a non-const 
reference from a const function. Now There is a const version which will not 
detach the shared data while the non-const version will detach from the shared 
data.


Diffs
-----

  libalkimia/CMakeLists.txt 3dbe4db 
  libalkimia/alkvalue.h 7c02403 
  libalkimia/alkvalue.cpp ae5d3a4 

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


Testing
-------

Succesfully ran KMyMoney and KMyMoney tests. See the attached screeshots for 
the callgrind data about AlkValue obtained while loading the same KMyMoney file 
without and with this change. Note that the second run also contains some 
MyMoneyMoney optimizations based on this feature (subject of a different review 
request).


File Attachments
----------------

Callgrind data using AlkValue from alkimia 4.3.2
  
https://git.reviewboard.kde.org/media/uploaded/files/2014/10/26/f79cfa4b-b01a-4d14-adbe-dc905ad1a4c9__alk-value.png
Callgrind data using AlkValue from alkimia 4.4.0 (with implicit sharing)
  
https://git.reviewboard.kde.org/media/uploaded/files/2014/10/26/ceb1cb24-fe5e-414e-a0c1-09746bcb9bcc__alk-value-implicitly-shared.png


Thanks,

Cristian Oneț

_______________________________________________
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel

Reply via email to