Startup time

Derek Atkins warlord at MIT.EDU
Mon Aug 17 22:25:59 EDT 2009


Hi,

"hasmeta at yahoo.com" <hasmeta at yahoo.com> writes:

>> No, there's no way to load them dynamically upon request
>> because GnuCash
>> builds the menu items of reports dynamically.  This
>> lets you effectively
>> drop in new reports and GnuCash will just load them and put
>> them into
>> the menu for you.  You can't have it both ways, and
>> IMHO being able to
>> dynamically add reports is more important.
>> 
>
> I may be over my head in the internals of the implementation, so
> correct me if I am wrong, but from what you say, it seems that startup
> code is going through all shared libraries in some directory, loading
> them, then calling some function to get report characteristics and
> then add it to the reports menu. This wouldd explain why building a
> menu of less than 50 items total is taking such a long time. And if I
> wanted to add in an additional report, I'd have to copy the shared
> library into that directory, then restart gnucash so that the report
> would appear on the menu?

not quite...  The reports are scheme files, not shared libraries.  Yes,
it is loading each scheme file, but that's not a lot of time.  The
shared libraries (GNC Modules) are cached, so it only has to load them
once.  But it does take time to load the module and dependencies.

Seriously, GnuCash is just a large application.  It takes time to load.
Quicken takes time to load.  Quickbooks takes time to load.  Open Office
takes time to load.  MS Word takes time to load.   Loading time is just
a fact of life.  You just need to learn to live with it.

Seriously, how long is it taking to load?  15 seconds?  20?   Yes, if
it's taking multiple minutes to load then there's a problem, but
honestly the only time I've seen that happen is due to a bug in the
dynamic loader of some versions of BSD.

> I am not against dynamically building menu items; my point is,
> building menu items shouldn't take that long. Why not cache the
> results into some text file, and, at next startup, if the text file
> exists, read report characteristics from there instead? That way, you
> can build the menu in a second or less. You could repopulate the text
> file after startup in a low priority thread or put in a menu item that
> says "Refresh Reports" to repopulate the text file and recreate the
> menu.

If you cache it how do you detect that the cache is stale?  Also, I'd
rather frontload all the loading so that the application is responsive
when I use it, rather than delaying the loading so that when I click a
menu item it takes a significant amount of time to do something.

> I realize that, but it takes noticeably long for the perl checker
> script to load, run and return the results back to gnucash: about 4
> seconds on my Intel Core XP machine. This is a lot of time just to
> determine if a menu item is to be greyed out. Also, a greyed out menu
> item doesn't give any feedback to the user as to what may be broken.

4 seconds just isn't a large amount of time in the grand scheme of
things.  Seriously.  Also, it's not a matter of being broken, but it's a
feature that isn't instaled.   PERL is a heavy-weight application.
Sorry, there's just nothing to do there.

> So why not keep it always on? When the user chooses it, you spawn
> whatever perl script is necessary to get the quotes. If the process
> fails, because there's no perl, you say, 'this feature depends on
> perl, please install it'. If the process fails because perl couldn't
> find Finance::Quote in @LIB, you say 'install Finance::Quote'. If no
> internet, 'check internet/proxy settings', so on and so forth...

I think most users would be more annoyed.  I can see the email now (in
fact, I think I've seen it before, years and years ago)...  "Hey, why
can I click on the button if the feature isn't available?"  

You just can't please everybody.

> Lastly, I appreciate all the effort that the developers of this
> software have put together (and even with a relatively longer startup
> time due to this or that, I am *not* going back to Quicken).

I'm glad you enjoy the program, even if it does take longer to load than
you like.  Honestly, I keep the program open all the time.  I start it
up and I don't close it.  I also make sure to save early and save often.

> --Hasmet
>
>> 
>> > --Hasmet
>> 
>> > Please remember to CC this list on all your replies.
>> > You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list