Skip to content

perf(api): bound cell measuring when rendering terminal tables (backport to 1.21.85) - #237

Closed
adityathebe wants to merge 1 commit into
release/v1.21.85from
backport/table-bounded-cell-width-1.21.85
Closed

adityathebe wants to merge 1 commit into
release/v1.21.85from
backport/table-bounded-cell-width-1.21.85

Conversation

@adityathebe

Copy link
Copy Markdown
Member

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.85 is v1.21.85 unchanged. This PR adds only the #236 commit. A v1.21.85.x tag is not a valid Go module version, so once this merges merivo will pin the merge commit as a pseudo-version.

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.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fee813eb-2e2d-402c-9c1c-0d199d0bc2f7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration
lint: oxlint 0 1 0 135ms
lint: tsc 2 1 0 3.7s
lint: betterleaks 0 0 1 -
lint: golangci-lint 1 0 0 47.5s
lint: react-doctor 1 0 0 4.8s

Totals: 4 passed · 2 failed · 1 skipped · 56.3s

Failing linters

tsc — error

tsc wrapper failed: exit status 1
Stderr:
gavel-tsc: cannot load 'typescript' from /home/runner/work/clicky/clicky/task/ui/node_modules. Install it with your package manager (e.g. `npm i -D typescript`).

oxlint — 3 violation(s)

  • /home/runner/work/clicky/clicky/examples/enitity/webapp/src/api.ts:53 — Empty fallbacks in spreads are unnecessary (oxlint)
  • /home/runner/work/clicky/clicky/examples/enitity/webapp/src/api.ts:133 — Empty fallbacks in spreads are unnecessary (oxlint)
  • /home/runner/work/clicky/clicky/examples/enitity/webapp/src/LinkExamplesPage.tsx:217 — Empty fallbacks in spreads are unnecessary (oxlint)

View full results

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration
aichat 24 0 0 2ms
api 326 0 0 32ms
cache 28 0 0 125ms
celfilter 14 0 9 14ms
clicky 128 0 0 36.1s
clirender 18 0 0 6ms
enitity 1 0 0 6.8s
entity 171 0 0 210ms
entitydemo 2 0 0 1ms
excel 12 0 0 67ms
exec 144 0 1 11.5s
extensions 1 0 0 102.541µs
filter 10 0 3 615.555µs
flags 40 0 0 1ms
formatters 81 0 0 9ms
github.com/flanksource/clicky 28 0 0 3.0s
github.com/flanksource/clicky/api 258 0 0 270ms
github.com/flanksource/clicky/api/tailwind 434 0 0 20ms
github.com/flanksource/clicky/api/wasmtest 1 0 0 230ms
github.com/flanksource/clicky/cmd/clicky 4 0 0 10ms
github.com/flanksource/clicky/docs 19 0 0 -
github.com/flanksource/clicky/entity 153 0 0 -
github.com/flanksource/clicky/examples/enitity/internal/entitydemo 7 0 0 -
github.com/flanksource/clicky/exec 3 0 0 440ms
github.com/flanksource/clicky/flags 53 0 0 10ms
github.com/flanksource/clicky/formatters 77 0 1 50ms
github.com/flanksource/clicky/formatters/http 38 0 0 -
github.com/flanksource/clicky/formatters/tests 201 0 1 80ms
github.com/flanksource/clicky/internal/gumchoose 2 0 0 -
github.com/flanksource/clicky/lint 13 0 0 -
github.com/flanksource/clicky/markdown 10 0 0 80ms
github.com/flanksource/clicky/mcp 102 0 0 3.2s
github.com/flanksource/clicky/middleware 31 0 0 -
github.com/flanksource/clicky/prompt 15 0 0 -
github.com/flanksource/clicky/route 12 0 0 -
github.com/flanksource/clicky/rpc 378 0 1 210ms
github.com/flanksource/clicky/rpc/http 8 0 0 10ms
github.com/flanksource/clicky/task 168 0 0 23.9s
github.com/flanksource/clicky/valkey 1 0 0 340ms
gomplatefilter 2 0 0 3ms
http 5 0 0 384.607µs
lint 16 0 0 19.5s
markdown 4 0 0 72ms
mcp 4 0 0 4ms
metrics 7 0 0 4ms
middleware 38 0 0 10ms
process 44 0 0 1.8s
rpc 53 0 0 1.9s
schemaform 61 0 0 1.8s
sse 74 0 0 1.8s
task 97 0 0 6.6s
tests 11 0 47 7ms
text 78 0 0 305ms
urlfetch 4 0 0 6ms
valkey 46 0 0 337ms

Totals: 3560 passed · 0 failed · 63 skipped · 2m1s

View full results

Copy link
Copy Markdown
Member Author

Not needed: #236 is merged to main, and merivo will use the next clicky release instead of a 1.21.85 backport.

@adityathebe adityathebe closed this Nov 2, 2026
@adityathebe
adityathebe deleted the backport/table-bounded-cell-width-1.21.85 branch November 2, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant