hledger/hledger-lib/Hledger
Oleg Bulatov abd7d60884 imp:lib:valuation: optimize price lookup with pre-built indexes [#2511]
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>
2026-01-02 17:05:24 -10:00
..
Data imp:lib:valuation: optimize price lookup with pre-built indexes [#2511] 2026-01-02 17:05:24 -10:00
Read dev: cleanup 2025-12-16 00:18:28 -10:00
Reports fix:PeriodData: simplify, use Day keys [#2479] 2025-10-11 11:27:58 -10:00
Utils dev:Hledger.Utils.IO: clarify expandPath, expandHomePath 2025-12-31 00:28:05 -10:00
Write dev: switch all qualifed imports to ImportQualifiedPost style 2025-09-29 19:28:59 -10:00
Data.hs dev!: lib: Refactor splitSpan to return Maybe DayPartition. 2025-10-09 15:31:28 -10:00
Query.hs fix:lib:Hledger.Query: words'': Parse escaped quotes in quoted patterns 2025-12-26 12:09:49 -10:00
Read.hs imp:aregister: correct that comment about transaction numbering 2025-12-07 17:44:01 -10:00
Reports.hs cln: tests: Remove test and tests, which are just aliases for testCase 2021-08-30 16:32:19 -10:00
Utils.hs dev!: lib: Refactor splitSpan to return Maybe DayPartition. 2025-10-09 15:31:28 -10:00