[Kmymoney-devel] AccountsModel loadInstitution and loadSubaccounts recursiveness

Cristian Oneţ onet.cristian at gmail.com
Mon Sep 20 16:15:15 CEST 2010


On Sun, Sep 19, 2010 at 4:44 PM, Alvaro Soliverez <asoliverez at kde.org> wrote:
> Hello Cristian,
Hi Alvaro,

> I'm checking the results of the callgrind profiling.
>
> I've found some oddness.
>
> There are two methods in the AccountsModel that get called and incur
> the most time, loadSubAccounts and loadInstitution.
> The AccountModel::load() method calls both, but in turn, the
> loadSubAccounts method calls loadInstitution too.
>
> I haven't looked at it in enough detail to verify if that's correct or
> it can be avoided, because I was looking for something else.
>
> Could you look into it and check whether that's correct?

Yes it is correct. The AccountModel::loadInstitution function creates
the needed items in the model for the institutions view for each
account (that is why it's called from load sub-accounts also). The
best way to optimize the accounts model (and other parts of the
application) would be to add more fine grained change signaling then
the now existing dataChanged signal. So until we don't know what has
changed we need to sync all the data between the model and the data
storage and that takes time. I still need to take a look at this if we
can gain some speed without doing the extra development of changing
dataChanged but I think the time has come to do just that. Because
that will be needed in the ledger also where for example everything is
reloaded if the status of the transaction is changed.

Regards,
Cristian


More information about the KMyMoney-devel mailing list