Replace O(n log n) re-sorting of all prices on every valuation date with O(log n) indexed lookups. By pre-building sorted price indexes once at startup using O(n log n) time, we avoid redundant work during reports. This significantly improves performance for --value=end,COMM with daily reports over long periods and large price databases. Implementation: - PriceIndex maps commodity pairs to a Map from date to effective price, enabling O(log n) temporal lookups via M.lookupLE. - DefaultValuationIndex provides efficient resolution of destination commodities using the same temporal logic. - makePriceGraph is updated to consume these indexes. Signed-off-by: Oleg Bulatov <oleg@bulatov.me> |
||
|---|---|---|
| .. | ||
| Hledger | ||
| test | ||
| Text | ||
| .date.m4 | ||
| .ghci | ||
| .version | ||
| .version.m4 | ||
| CHANGES.md | ||
| hledger-lib.cabal | ||
| Hledger.hs | ||
| LICENSE | ||
| package.yaml | ||
| README.md | ||
| Setup.hs | ||
hledger-lib
A reusable library containing hledger’s core functionality. This is used by most hledger* packages so that they support the same common file formats, command line options, reports etc.
See also: the project README and home page.