[Kmymoney-devel] KMyMoney Dependencies and Build Requirements

Cristian Oneț onet.cristian at gmail.com
Sat Oct 25 11:37:41 UTC 2014


2014-10-24 21:24 GMT+03:00 Christian Dávid <christian-david at web.de>:
> Am Donnerstag, 23. Oktober 2014, 12:38:31 schrieb Cristian Oneț:
>> I've started to do some profiling again and found another argument for
>> the case that enabling C++11 would be a great benefit to the project.
>>
>> 1. We could really benefit from move semantics, our API is a perfect
>> fit for that (think about all the MyMoney* objects)
>> For example while loading a file the method which takes most CPU
>> cycles in the file storage object is MyMoneySeqAccessMgr::price [1].
>> You might ask why is that, well... read [2] (I know it's long) and
>> you'll notice that the compiler can't perform RVO [3]. We need to
>> improve the performance of the code we write but we should not
>> sacrifice the readability to do this. We can fix stuff using our
>> current C++03 but to do it properly without hurting readability I
>> would suggest switching to C++11.
>
> I am not sure if C++11 improves this specific situation (without reading [2]).
> The MyMoneyObjects mainly contain QStrings, QDates and MyMoneyMoney. Each of
> them has to be moved individually. But as they are implicitly shared already
> (maybe MyMoneyMoney not?!) this just saves an increment and decrement of the
> ref-counter in the implicitly shared objects. So the performance improvement
> here should be rather low.

You're probably right, Qt objects would not benefit from move
semantics. But AlkValue could probably use a COW since
constructing/destructing a GMP value seems a pretty expensive
operation. Think about all those '0' values we use in KMyMoney (like
an invalid MyMoneyPrice object). Checkout the attached screenshot,
AlkValue constructing/destructing is second to QString while loading a
file.

Regards,
Cristian

>
> Here is a sentence which I like so much, I want to repeat it:
>> We need to improve the performance of the code we write but we should not
>> sacrifice the readability to do this.
>
>> […]
>> 3. It would allow us (the developers) to learn new stuff and write better
>> code Although I'm a C++ developer I didn't write a single line of C++11
>> code yet. We should be learning and having fun while working in our free
>> time.
>
> I totally agree, Cristian!
>
>> So, I totally agree with you Chris, let's enable C++11 in KMyMoney, I
>> know that KDevelop already needs C++11 so it shouldn't restrict us
>> from distributing KMyMoney in any way. I'll take care of the necessary
>> build system changes.
>
> That is cool! I am just afraid of the merge with add-onlinebanking…
>
> Greetings
> Chris
>
> _______________________________________________
> KMyMoney-devel mailing list
> KMyMoney-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kmymoney-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alk-value.png
Type: image/png
Size: 115366 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20141025/b89c3563/attachment-0001.png>


More information about the KMyMoney-devel mailing list