mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Commit imap conversions once per account instead of per import map slot.
Commits are expensive in the SQL backend; this resulted in a >40x speedup in loading a database with 3400 import map slots (>2 hours to 3 minutes).
This commit is contained in:
parent
c6a72cc596
commit
4fc61b2ac8
@ -5928,7 +5928,7 @@ convert_imap_account (Account *acc)
|
|||||||
if (g_list_length (imap_list) > 0) // we have mappings
|
if (g_list_length (imap_list) > 0) // we have mappings
|
||||||
{
|
{
|
||||||
PINFO("List length is %d", g_list_length (imap_list));
|
PINFO("List length is %d", g_list_length (imap_list));
|
||||||
|
xaccAccountBeginEdit(acc);
|
||||||
for (node = imap_list; node; node = g_list_next (node))
|
for (node = imap_list; node; node = g_list_next (node))
|
||||||
{
|
{
|
||||||
Account *map_account = NULL;
|
Account *map_account = NULL;
|
||||||
@ -5939,7 +5939,6 @@ convert_imap_account (Account *acc)
|
|||||||
|
|
||||||
if (map_account != NULL) // we have an account, try and update it
|
if (map_account != NULL) // we have an account, try and update it
|
||||||
convert_imap_entry (imapInfo, map_account);
|
convert_imap_entry (imapInfo, map_account);
|
||||||
|
|
||||||
// Free the members and structure
|
// Free the members and structure
|
||||||
g_free (imapInfo->category_head);
|
g_free (imapInfo->category_head);
|
||||||
g_free (imapInfo->full_category);
|
g_free (imapInfo->full_category);
|
||||||
@ -5947,6 +5946,7 @@ convert_imap_account (Account *acc)
|
|||||||
g_free (imapInfo->count);
|
g_free (imapInfo->count);
|
||||||
g_free (imapInfo);
|
g_free (imapInfo);
|
||||||
}
|
}
|
||||||
|
xaccAccountCommitEdit(acc);
|
||||||
}
|
}
|
||||||
g_free (acc_name);
|
g_free (acc_name);
|
||||||
g_list_free (imap_list); // Free the List
|
g_list_free (imap_list); // Free the List
|
||||||
|
Loading…
Reference in New Issue
Block a user