mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Raise edit level of all accounts before loading transactions and splits
This prevents calling xaccAccountRecomputeBalanceInCurrency on each split that gets added, which was exponentially increasing load times. On a huge test book the load time dropped from 53 minutes to 1m20s.
This commit is contained in:
parent
221c46585c
commit
5775662b52
@ -714,7 +714,13 @@ void
|
||||
GncSqlTransBackend::load_all (GncSqlBackend* sql_be)
|
||||
{
|
||||
g_return_if_fail (sql_be != NULL);
|
||||
|
||||
auto root = gnc_book_get_root_account (sql_be->book());;
|
||||
gnc_account_foreach_descendant(root, (AccountCb)xaccAccountBeginEdit,
|
||||
nullptr);
|
||||
query_transactions (sql_be, "");
|
||||
gnc_account_foreach_descendant(root, (AccountCb)xaccAccountCommitEdit,
|
||||
nullptr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user