hledger/hledger-lib
Simon Michael c23fc8b671 speed up -V/--value by converting reports, not the journal (#999)
Instead of converting all journal amounts to value early on, we now
convert just the report amounts to value, before rendering.

This was basically how it originally worked (for the balance command),
but now it's built in to the four basic reports used by print,
register, balance and their variants - Entries, Postings, Balance,
MultiBalance - each of which now has its own xxValue helper.

This should mostly fix -V's performance when there are many
transactions and prices (the price lookups could still be optimised),
and allow more flexibility for report-specific value calculations.

+------------------------------------------++-----------------+-------------------+--------------------------+
|                                          || hledger.999.pre | hledger.999.1sort | hledger.999.after-report |
+==========================================++=================+===================+==========================+
| -f examples/1000x1000x10.journal bal -V  ||            1.08 |              0.96 |                     0.76 |
| -f examples/2000x1000x10.journal bal -V  ||            1.65 |              1.05 |                     0.73 |
| -f examples/3000x1000x10.journal bal -V  ||            2.43 |              1.58 |                     0.84 |
| -f examples/4000x1000x10.journal bal -V  ||            4.39 |              1.96 |                     0.93 |
| -f examples/5000x1000x10.journal bal -V  ||            7.75 |              2.99 |                     1.07 |
| -f examples/6000x1000x10.journal bal -V  ||           11.21 |              3.72 |                     1.16 |
| -f examples/7000x1000x10.journal bal -V  ||           16.91 |              4.72 |                     1.19 |
| -f examples/8000x1000x10.journal bal -V  ||           27.10 |              9.83 |                     1.40 |
| -f examples/9000x1000x10.journal bal -V  ||           39.73 |             15.00 |                     1.51 |
| -f examples/10000x1000x10.journal bal -V ||           50.72 |             25.61 |                     2.15 |
+------------------------------------------++-----------------+-------------------+--------------------------+

There's one new limitation, not yet resolved: -V once again can pick a
valuation date in the future, if no report end date is specified and
the journal has future-dated transactions. We prefer to avoid that,
but reports currently are pure and don't have access to today's date.
2019-04-23 17:39:01 -07:00
..
Hledger speed up -V/--value by converting reports, not the journal (#999) 2019-04-23 17:39:01 -07:00
other/ledger-parse lib: restrict imports, avoiding GHCI clashes 2016-11-20 10:27:16 -08:00
test tests: make doctests suite run with old ghcs 2018-09-07 12:34:51 -07:00
Text lib: add a custom parse error for "re-parsing" 2018-11-22 14:09:32 -08:00
.ghci tools: .ghci for each package, sets shorter prompt 2016-04-15 16:06:45 -07:00
.version ; lib, cli, ui, web, api: bump to dev version 2019-03-20 16:18:04 -07:00
CHANGES.md ; merge latest changelogs 2019-03-20 16:18:04 -07:00
defs.m4 ; propagate dev version bump 2019-03-20 17:13:59 -07:00
hledger_csv.5 regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_csv.info regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_csv.m4.md csv: doc: more tweaks (#1000) 2019-04-06 10:51:18 -07:00
hledger_csv.txt regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_journal_directives.m4.md lib: doc: journal: describe current directive semantics, finally 2018-06-20 19:41:28 -07:00
hledger_journal.5 regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_journal.info regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_journal.m4.md ;doc: journal: promote "auto postings" term; clarify scope 2019-03-08 19:59:45 -08:00
hledger_journal.txt regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timeclock.5 regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timeclock.info regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timeclock.m4.md remove numbers from all but nroff filenames 2017-12-06 18:35:18 -08:00
hledger_timeclock.txt regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timedot.5 regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timedot.info regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger_timedot.m4.md doc: journal: directives & periodic/automated cleanups 2018-04-29 18:02:16 -07:00
hledger_timedot.txt regen cabal files/manuals 2019-03-01 16:17:25 -08:00
hledger-lib.cabal ; propagate dev version bump 2019-03-20 17:13:59 -07:00
Hledger.hs rename easytests_* to tests_* 2018-09-06 13:13:26 -07:00
LICENSE split off hledger-lib package, containing core types & utils 2010-03-22 01:44:59 +00:00
package.yaml ; propagate dev version bump 2019-03-20 17:13:59 -07:00
README doc: ensure all five main packages have a README 2016-04-12 11:13:01 -07:00
Setup.hs Revert "remove Setup.hs files again, fixing a yesod devel warning" 2014-05-24 13:39:09 -07:00

A reusable library containing hledger's core functionality.
This is used by most hledger* packages for common data parsing,
command line option handling, reporting etc.