Hello,
during the process of evaluating hledger and ledger I've noticed the
difference in performance between the two by the factor of ~30x.
However, we observed that there is significant difference in performance
with ledger itself depending on the type of ledger data it has to parse.
Here are the details...
The file with which we start is converted personal.gnucash file produced
by the pygnucash converter holding my personal transaction in last few
years.
The personal.dat file is 581K in size and here is the stats:
$ ledger stats -f personal.dat
Time period: 10-Oct-31 to 14-Dec-15 (1506 days)
Files these postings came from:
/home/gour/tmp/ledger/personal.dat
Unique payees: 2161
Unique accounts: 144
Number of postings: 7246 (4.8 per day)
Uncleared postings: 0
Days since last post: -95
Posts in last 7 days: 46
Posts in last 30 days: 279
Posts seen this month: 56
The personal.dat looks like:
commodity template
note template
commodity EUR
note Euro
commodity HRK
note Croatian Kuna
account Expenses:Adjustment
note Adjustment
check commodity == "HRK"
account Income:Interest Income:Other Interest
note Other Interest
check commodity == "HRK"
account Expenses:Hrana
note Hrana
check commodity == "HRK"
account Expenses:Uređaji:Audio/video
note Audio/video
check commodity == "HRK"
[...]
P 2011/12/31 23:00:00 EUR 7.6 HRK
P 2012/11/06 23:00:00 EUR 7.60456273764 HRK
P 2013/01/31 23:00:00 EUR 7.51 HRK
P 2014/02/09 23:00:00 EUR 7.40740740741 HRK
2011/12/31 * radovi na kućici (Bizek)
Equity:Početni iznosi 3918.00 HRK
Liabilities:Nandišvara -3918.00 HRK
2011/12/31 * početni iznos
Assets:Saša (Erste) 84.03 HRK
Equity:Početni iznosi -84.03 HRK
[...]
In order to be able to process the file with hledger I had to strip
top-level directives not recognized by it which was done with:
The resultant persoanl.journal file is 463K in size and it looks like:
2011/12/31 * radovi na kućici (Bizek)
Equity:Početni iznosi 3918.00 HRK
Liabilities:Nandišvara
2011/12/31 * početni iznos
Assets:Saša (Erste) 84.03 HRK
Equity:Početni iznosi
[...]
which is the same personal.dat stripped if {commodity,account,P}
directives.
Now the interesting part is to note the time required by ledger to
process them...
$ time ledger register -f personal.dat Gorivo >/dev/null
2.56user 0.00system 0:02.60elapsed 98%CPU (0avgtext+0avgdata 12840maxresident)k
8192inputs+0outputs (1major+3312minor)pagefaults 0swaps
$ time ledger register -f personal.journal Gorivo >/dev/null
0.13user 0.00system 0:00.14elapsed 98%CPU (0avgtext+0avgdata 12436maxresident)k
0inputs+0outputs (0major+3212minor)pagefaults 0swaps
which makes the difference of ~20x in processing two different files.
For comparison, hledger requires:
$ time hledger register -f personal.journal Gorivo >/dev/null
3.90user 0.03system 0:04.72elapsed 83%CPU (0avgtext+0avgdata 66780maxresident)k
14224inputs+0outputs (4major+16954minor)pagefaults 0swaps
which makes it 30x or ~1.5x slower.
I was not repeating it thousand of times, but the average goes in the
range of ~20x difference in speed.
Let me finish with the stats for both files:
$ ledger stats -f personal.dat
Time period: 10-Oct-31 to 14-Dec-15 (1506 days)
Files these postings came from:
/home/gour/tmp/ledger/personal.dat
Unique payees: 2161
Unique accounts: 144
Number of postings: 7246 (4.8 per day)
Uncleared postings: 0
Days since last post: -95
Posts in last 7 days: 46
Posts in last 30 days: 279
Posts seen this month: 56
$ ledger stats -f personal.journal
Time period: 10-Oct-31 to 14-Dec-15 (1506 days)
Files these postings came from:
/home/gour/tmp/ledger/personal.journal
Unique payees: 2157
Unique accounts: 144
Number of postings: 7231 (4.8 per day)
Uncleared postings: 0
Days since last post: -95
Posts in last 7 days: 46
Posts in last 30 days: 279
Posts seen this month: 56
As you can see there are some difference in the interpretation of the
number of transactions, but I was not going into details why is it so.
hledger's stats is as follows:
$ hledger stats -f personal.journal
Main journal file : /home/gour/tmp/ledger/personal.journal
Included journal files :
Transactions span : 2010-10-31 to 2014-12-16 (1507 days)
Last transaction : 2014-12-15 (95 days from now)
Transactions : 3309 (2.2 per day)
Transactions last 30 days: 117 (3.9 per day)
Transactions last 7 days : 13 (1.9 per day)
Payees/descriptions : 2157
Accounts : 144 (depth 4)
Commodities : 3 (, EUR, HRK)
Now I really wonder how is it that ledger is one order of magnitude
(~20x) slower (and it falls in the hledger's range) when it has to parse
the file consisting just of top-level directives which build chart of
accounts?
Sincerely,
Gour
--
The spirit soul bewildered by the influence of false ego thinks
himself the doer of activities that are in actuality carried out
by the three modes of material nature.
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.