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:
Geert Janssens 2018-09-15 16:41:37 +02:00
parent 221c46585c
commit 5775662b52

View File

@ -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