Created attachment 373863 [details] (Scrubbed) gnucash repro file Hello. To reproduce the issue, open the attached gnucash file and try to open the Import Map Editor on windows with the latest stable 4.1 build. Thanks
I have loaded this file and used the Import map editor, it takes about 30 secs to load 4 'CSV Account Maps' I think this is as a result of the routine to flatten of the import KVP data. The problem is there is no progress indication but this maybe resolved with Chris's progress bar PR, will need to try that. The other problem is that if the flattening makes no changes then the book property is not set and the flattening process keeps being run. Will try to have a look at that but I think it was also raised on another BUG.
@Bob - not yet -- my https://github.com/Gnucash/gnucash/pull/786 is stalled because I wish to augment and expose check_import_map_data as gnc_account_check_import_map_data but not sure how to give it an *optional* callback. Assist would be nice in fixing my C.
(In reply to Bob from comment #1) > I have loaded this file and used the Import map editor, it takes about 30 > secs to load 4 'CSV Account Maps' > > I think this is as a result of the routine to flatten of the import KVP > data. The problem is there is no progress indication but this maybe resolved > with Chris's progress bar PR, will need to try that. > > The other problem is that if the flattening makes no changes then the book > property is not set and the flattening process keeps being run. > > Will try to have a look at that but I think it was also raised on another > BUG. One bug that looks like the second problem is bug 797895.
Profiling opening the imap editor on repro.gnucash took 96 seconds and showed that most of the time was spent in xaccAccountCommitEdit. Simply moving the check of whether flattened imap vector is empty to before the xaccBeginEdit call and returning if it is makes the process so fast that I can't find check_import_map_data in the profile. Incidentally, the expensive part of xaccAccountCommitEdit is updating the account page's tree model in gnc_tree_model_account_event_handler. The two hot calls are gnc_tree_mode_account_clear_cached_values clear_account_cached_values gtk_tree_model_row_changed and propagate_change gtk_tree_model_row_changed We could get a 50% speed up in committing account changes if we could call gtk_tree_model_row_changed only once and a whole lot more if we could figure out how to do it only for the row that actually changed.