Skip to content

Commit

Permalink
imp: reg: areg: Align to first 1000 postings by default, rather than …
Browse files Browse the repository at this point in the history
…100.

This has the same performance characteristics for a big decrease in alignment
issues. 1000 postings seems to still put it under the memory bottleneck.
  • Loading branch information
Xitian9 authored and simonmichael committed Mar 11, 2022
1 parent 129f37c commit cbdd86f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hledger/Hledger/Cli/Commands/Aregister.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Each `aregister` line item shows:
Transactions making a net change of zero are not shown by default;
add the `-E/--empty` flag to show them.

For performance reasons, column widths are chosen based on the first 100 lines;
For performance reasons, column widths are chosen based on the first 1000 lines;
this means unusually wide values in later lines can cause visual discontinuities
as column widths are adjusted. If you want to ensure perfect alignment,
at the cost of more time and memory, use the `--align-all` flag.
Expand Down
2 changes: 1 addition & 1 deletion hledger/Hledger/Cli/Commands/Register.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $ hledger register checking

With --date2, it shows and sorts by secondary date instead.

For performance reasons, column widths are chosen based on the first 100 lines;
For performance reasons, column widths are chosen based on the first 1000 lines;
this means unusually wide values in later lines can cause visual discontinuities
as column widths are adjusted. If you want to ensure perfect alignment,
at the cost of more time and memory, use the `--align-all` flag.
Expand Down
2 changes: 1 addition & 1 deletion hledger/Hledger/Cli/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ postingsOrTransactionsReportAsText alignAll opts itemAsText itemamt itembal repo
mconcat . snd $ mapAccumL renderItem (startWidth amt, startWidth bal) itemsWithAmounts
where
minWidth = 12
chunkSize = 100
chunkSize = 1000

renderItem (amtWidth, balWidth) item@(_, amt, bal) = ((amtWidth', balWidth'), itemBuilder)
where
Expand Down

0 comments on commit cbdd86f

Please sign in to comment.