Hi Vinod,

Please refer to this thread and particularly last message of the
thread.
http://groups.google.com/group/ledger-cli/browse_thread/thread/da86281229a3fabd/

I believe that performance issue about ledger v3 are related to "price
relationships". In your example, you used "ledger -V", and here is the
point. With this command, for every date, the ledger program has to
find the price that is in your price.db file. In my case, I use "-X",
but like "-V", it computes the price relationships.


I solved this issue by (I tested this, and this really helps):
- using ledger -M or -Y. By computing "-V" only once per month or per
  year, you reduce a lot the price relationship to compute. Yes, I
  abandoned to use "-V" for computing daily values.
- reducing the price.db file, with only one value per month. This also
  reduce the price relations to compute by ledger


There is also one point that can help. I did not tested it with real
performance tests. First let's build the pricemap with commands:

$ ledger pricemap > /tmp/pricemap.dot
$ circo -Tpdf -o/tmp/pricemap.pdf /tmp/pricemap.dot

By looking to /tmp/pricemap.pdf, you should only have hub (or star)
with your reference currency in the middle. You should not have
triangle, or square, or any polygons, that would mean you have
circular price relationship. At this point, I am sure that those
polygons can not speed up ledger, only add confusion to ledger.

Thierry


On 9 oct, 00:38, Vinod Kurup <vvku...@gmail.com> wrote:
> I tried ledger 3.0 after using a combination of ledger 2.5 and 2.6 happily
> for many years. I've found 3.0 to be too slow for my needs. My ledger file
> is huge and I use the emacs reconcile mode extensively, which calls ledger
> frequently, so performance issues are very noticeable.
>
> Please note that this really isn't a complaint. I know 3.0 brings a lot of
> new functionality and bug fixes, and performance may be perfectly fine for
> normal size ledger files. I just wanted to report this in case I'm doing
> something wrong or there exist some easy ways to improve 3.0 performance.
> For the moment, I'm sticking with 2.5 since it works perfectly for me.
>
> All of the following done on a quad core dell desktop, ubuntu 10.10:
>
> *TL;DR=> *
> *2.5 (register = 5 sec, balance = 0.06 sec)*
> *2.6 (register = 3 min, balance = 0.9 sec)*
> *3.0 (register = 65 min, balance = 4.6 sec)*
>
> vinod@cartman:~ $ uname -a
> Linux cartman 2.6.35-30-generic-pae #59-Ubuntu SMP Tue Aug 30 16:16:14 UTC
> 2011 i686 GNU/Linux
> # FILE IS BIG (dating back to 1991)
> vinod@cartman:~ $ wc -l $LEDGER_FILE
> 85406 /home/vinod/Dropbox/ledger.dat
>
> # ledger 2.5
> vinod@cartman:~ $ ./src/ledger-2.5/ledger -v
> Ledger 2.5, the command-line accounting tool
> # Register command
> vinod@cartman:~ $ time ./src/ledger-2.5/ledger -V reg | wc -l
> 54363
>
> real 0m5.516s
> user 0m5.416s
> sys 0m0.104s
> # Balance command
> vinod@cartman:~ $ time ./src/ledger-2.5/ledger -V bal
> real 0m0.062s
> user 0m0.036s
> sys 0m0.024s
>
> # ledger 2.6
> vinod@cartman:~ $ ledger -v
> Ledger 2.6.2, the command-line accounting tool
> # Register command
> vinod@cartman:~ $ time ledger -V reg | wc -l
> 46072
>
> real 3m4.285s
> user 3m3.159s
> sys 0m1.048s
> # Balance command
> vinod@cartman:~ $ time ledger -V bal
> real 0m0.945s
> user 0m0.696s
> sys 0m0.248s
>
> # ledger 3.0
> vinod@cartman:~ $ ./src/ledger/ledger -v
> Ledger 3.0.0-20110325, the command-line accounting tool
> # Register command
> vinod@cartman:~ $ time ./src/ledger/ledger -V reg | wc -l
> 47378
>
> real 65m59.653s
> user 65m52.407s
> sys 0m2.424s
> # Balance command
> vinod@cartman:~ $ time ./src/ledger/ledger -V bal
> real 0m4.662s
> user 0m4.084s
> sys 0m0.052s

Reply via email to