Income/Expenses report
Tim Vail
jlyertv at fastmail.us
Thu Jan 8 22:35:28 EST 2009
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.
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cash-flow.patch
Type: text/x-diff
Size: 4195 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090108/1bccb837/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: report-utilities.patch
Type: text/x-diff
Size: 2573 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090108/1bccb837/attachment-0001.bin
More information about the gnucash-devel
mailing list