Repository navigation
perf(api): bound cell measuring when rendering terminal tables (backport to 1.21.85) - #237
Closed
adityathebe wants to merge 1 commit into
Closed
adityathebe wants to merge 1 commit into
adityathebe wants to merge 1 commit into
Conversation
Rendering a table whose cells hold large values (a rules-run result with hundreds of kilobytes of formula trace per cell) spent most of its time in grapheme-width measurement: clicky measured every cell in full to size the columns, then lipgloss measured each cell twice in its resizer and once more in ansi.Truncate, only to cut it to a few characters. A 418 KB merivo table took about 70s to print. No column is allocated more than the available width, so cell widths are now measured only up to that limit. Columns are pinned and Wrap is off, so lipgloss's output depends on a cell only through ansi.Truncate(cell, width*height); each cell is handed over as a prefix that truncates to the same string. Cells holding escape sequences or invalid UTF-8 are passed whole, since ansi.Truncate keeps their bytes past the cut. The rendered output is unchanged; the 418 KB table now prints in about 24s.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Contributor
Gavel summary
Totals: 4 passed · 2 failed · 1 skipped · 56.3s Failing linterstsc — erroroxlint — 3 violation(s)
|
Contributor
Gavel summary
Totals: 3560 passed · 0 failed · 63 skipped · 2m1s |
Member
Author
|
Not needed: #236 is merged to main, and merivo will use the next clicky release instead of a 1.21.85 backport. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #236 onto v1.21.85, so merivo can take the table-rendering fix without the dependency bumps on
main(commons 1.63, echo 4.16, excelize).release/v1.21.85is v1.21.85 unchanged. This PR adds only the #236 commit. Av1.21.85.xtag is not a valid Go module version, so once this merges merivo will pin the merge commit as a pseudo-version.