r17988 - gnucash/trunk/src/report/report-system - Reports: Speed up the report infrastructure. Patch by Mike Alexander.

Charles Day cedayiv at cvs.gnucash.org
Mon Mar 9 16:14:46 EDT 2009


Author: cedayiv
Date: 2009-03-09 16:14:46 -0400 (Mon, 09 Mar 2009)
New Revision: 17988
Trac: http://svn.gnucash.org/trac/changeset/17988

Modified:
   gnucash/trunk/src/report/report-system/html-acct-table.scm
   gnucash/trunk/src/report/report-system/report-system.scm
   gnucash/trunk/src/report/report-system/report-utilities.scm
Log:
Reports: Speed up the report infrastructure. Patch by Mike Alexander.

One set of changes speeds up the three functions in report-utilities.scm:
gnc:account-get-comm-balance-interval
gnc:accountlist-get-comm-balance-interval
gnc:accountlist-get-comm-balance-at-date

These can all be implemented as calls to
gnc:account-get-trans-type-balance-interval (with a minor change to it to
ignore the type parameter if it is #f) and it is much faster since it does a
single query instead of a loop over an account list.

The other set of changes is in gnc:html-acct-table-add-accounts! in
html-acct-table.scm.  This functions starts off by building a hash table of
account balances it cares about.  The code to do this did a recursive loop over
the relevant accounts.  I changed it to do a query to find the splits in the
accounts it cares about and build the hash table from them.  This speeds it up
by a couple of orders of magnitude.




More information about the gnucash-patches mailing list