[Kmymoney-devel] KMyMoney Dependencies and Build Requirements

Christian Dávid christian-david at web.de
Fri Oct 24 18:24:18 UTC 2014


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.

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



More information about the KMyMoney-devel mailing list