dev: reg: areg: Speed up reg and areg by only aligning to first 1000 items.

This commit is contained in:
Stephen Morgan 2022-02-03 20:35:39 +11:00 committed by Simon Michael
parent 4a80551406
commit cbc985d411
2 changed files with 4 additions and 4 deletions

View File

@ -130,8 +130,8 @@ accountTransactionsReportAsText copts reportq thisacctq items = TB.toLazyText $
title <> TB.singleton '\n' <> lines
where
lines = foldMap (accountTransactionsReportItemAsText copts reportq thisacctq amtwidth balwidth) items
amtwidth = maximumStrict $ 12 : widths (map itemamt items)
balwidth = maximumStrict $ 12 : widths (map itembal items)
amtwidth = maximumStrict $ 12 : widths (map itemamt $ take 1000 items)
balwidth = maximumStrict $ 12 : widths (map itembal $ take 1000 items)
widths = map wbWidth . concatMap (showMixedAmountLinesB oneLine)
itemamt (_,_,_,_,a,_) = a
itembal (_,_,_,_,_,a) = a

View File

@ -96,8 +96,8 @@ postingsReportAsText :: CliOpts -> PostingsReport -> TL.Text
postingsReportAsText opts items = TB.toLazyText lines
where
lines = foldMap (postingsReportItemAsText opts amtwidth balwidth) items
amtwidth = maximumStrict $ 12 : widths (map itemamt items)
balwidth = maximumStrict $ 12 : widths (map itembal items)
amtwidth = maximumStrict $ 12 : widths (map itemamt $ take 1000 items)
balwidth = maximumStrict $ 12 : widths (map itembal $ take 1000 items)
widths = map wbWidth . concatMap (showMixedAmountLinesB oneLine)
itemamt (_,_,_,Posting{pamount=a},_) = a
itembal (_,_,_,_,a) = a