Cc'ing the hledger list, with more data.
Derek Mahar wrote:
> On May 23, 8:18 pm, Simon Michael <[email protected]> wrote:
>> || hledger-0.4 | hledger-0.5 | ledger
>> =========================++=============+=============+=======
>> -f sample.ledger balance || 0.01 | 0.01 | 0.06
>> -f 1000.ledger balance || 1.33 | 1.46 | 0.53
>> -f 10000.ledger balance || 15.28 | 16.35 | 4.67
>
> Why is hledger so much slower than ledger? Does Haskell really
> generate code that is several times less efficient than code that C++
> generates?
Simon Michael wrote:
> Sometimes, but not necessarily.
>
> I think hledger can and should be faster, but it will take more work, and for
the moment I don't notice any speed
> difference in real-world use, so it's low priority. (10000.ledger contains
50000 transactions. My biggest personal
> ledger has 1000 and my timelog has 7000.)
Now that you've brought it up, of course, I can't stop noticing it..
A more detailed answer is given by this profile: http://joyful.com/repos/hledger/profs/200905241605.prof . It shows
hledger/ghc allocating/deallocating 1.7G of memory, and one function being called 2 million times (for a
7000-transaction ledger). So: some inefficient data structures/algorithms. Lots of room for improvement. :)