FQ loadtime on macosx problem

John Ralls jralls at ceridwen.us
Sat Oct 24 18:37:43 EDT 2015


> On Oct 24, 2015, at 3:09 PM, Erik Colson <eco at ecocode.net> wrote:
> 
> Hi,
> 
> Looking around in the Gnucash sources I think the hanging happens in
> this part of gnucash-bin.c
> 
> 
>    /* Install Price Quote Sources */
>    gnc_update_splash_screen(_("Checking Finance::Quote..."), GNC_SPLASH_PERCENTAGE_UNKNOWN);
>    scm_c_use_module("gnucash price-quotes");
>    scm_c_eval_string("(gnc:price-quotes-install-sources)");
> 
>    gnc_hook_run(HOOK_STARTUP, NULL);
> 
>    if (!nofile && (fn = get_file_to_load()))
>    {
>        gnc_update_splash_screen(_("Loading data..."), GNC_SPLASH_PERCENTAGE_UNKNOWN);
>        gnc_file_open_file(fn, /*open_readonly*/ FALSE);
>        g_free(fn);
>    }
>    else if (gnc_prefs_get_bool(GNC_PREFS_GROUP_NEW_USER, GNC_PREF_FIRST_STARTUP))
>    {
>        gnc_destroy_splash_screen();
>        gnc_ui_new_user_dialog();
>    }
> 
>    gnc_destroy_splash_screen();
> 
> 
> Following the code, you'll see that gnc_update_splash_screen first makes
> "Checking Finance::Quote..." appear. Then it does the job of loading FQ,
> but some other stuff happen before actually either destroying the splash
> screen or updating it.
> So, although the hanging is probably due to a prob with FQ, there's a
> chance it actually happens during
> 
>    gnc_hook_run(HOOK_STARTUP, NULL);
> 
> of which I can't say what it does. John, do you know ?
> 
> Otherwise we'll have to check what happens in either
>    scm_c_use_module("gnucash price-quotes");
>    scm_c_eval_string("(gnc:price-quotes-install-sources)");
> or
>    if (!nofile && (fn = get_file_to_load()))
> 
> I'll stop here for the moment. I'll come back to this next week
> probably.
> 

scm_c_use_module(gnucash price-quotes) just loads src/scm/price-quotes.scm. That won’t take long.
scm_c_eval_string() is one way of running a Scheme routine from C, and gnc:price-quotes-install-sources is what actually runs gnc-fq-check and prints the “Found Finance::Quote…” message.

The only startup hook is gnc_exp_parser_init, in src/app-utils/gnc-exp-parser.c. It doesn’t look to me like it’s doing anything that would block, and anyway it’s running after the “Found Finance::Quote” message.

Regards,
John Ralls




More information about the gnucash-user mailing list