Income/Expenses report

Charles Day cedayiv at gmail.com
Fri Jan 9 10:19:27 EST 2009


On Thu, Jan 8, 2009 at 7:35 PM, Tim Vail <jlyertv at fastmail.us> wrote:

> Andrew,
>
> Sorry for taking a long time getting back.  I finally went deeper into the
> net
> worth barchart report (which is also used to create the income/expenses
> chart
> report), and found that changing the report-utilities.scm's
> gnc:get-comm-balance-at-date function to NOT use qof resulted in a
> tremendous
> increase in speed.  Now, I'm not sure that is an acceptable solution --
> particularly when we are trying to transition to be closer to SQL.
> Nevertheless, I've attached the patch (report-utilities.patch) for this
> part.
>
> However, for cash flow report, I got that to run in less than a second too
> (processing all of my transactions dating back to 2006 -- something like
> 5000
> transactions).  The problem there was that the line:
>                          (gnc:report-percent-done (* 85 (/ work-done
> splits-to-do))))
>
> Was being run thousands of times.  That is a quite expensive call just to
> update the progress -- particularly if you have thousands of splits to do.
> What I did was change it to only update the progress every time it changes
> by
> 1%.  The progress still seems to move quite smoothly (in the short time
> that
> it runs -- it runs really fast.
>

Great find, Tim. Similar changes to the QIF importer improved speed by a
factor of 10. Perhaps other reports have the same inefficiency and can be
easily sped up too.


>
> So...there are two patches attached.
>
> Let me know if it works, and I'm curious what others have to say about the
> idea of swapping that report-utilities method to not use qof.  It is also
> possible that I'm missing something since for different commodities, maybe
> the qof method is more accurate.  I doubt that is the case, though.
>
> By the way, I've subscribed to the gnucash-devel digest.
>
> -Tim
>

Cheers,
Charles


More information about the gnucash-devel mailing list