perf: reduce board payload with compact card summaries - #572
Open
bionicman wants to merge 1 commit into
Open
Conversation
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.
Title
perf: reduce board payload with compact card summaries
Description
The authenticated board view only renders a small set of card indicators, but
board.byIdcurrently loads and serializes full descriptions, comments,attachments, checklists, and checklist items for every card. This becomes
expensive on large imported boards even after the relation lookups themselves
are indexed.
This adds an opt-in
cardView: "summary"read model and uses it for the boardUI. Each card receives only the aggregate values needed for its description,
comment, attachment, and checklist indicators. The existing
"full"moderemains the default, preserving the response contract for existing API
consumers and the public board view.
The change also removes redundant board requests from the new-card and
duplicate-card flows. A proposed 30-second board query
staleTimewas removedafter E2E testing showed that it could hide labels created from the card view.
The issue was reproduced on imported self-hosted data containing 38 boards and
14,524 cards. Representative active boards contained 1,203, 1,587, 1,890, and
2,511 cards.
For two large boards, the compressed
board.byIdresponse dropped fromapproximately 510–954 KB to 98–216 KB. End-to-end requests through the reverse
proxy dropped from roughly 2.15–3.24 seconds to 1.29–1.60 seconds.
EXPLAIN (ANALYZE, BUFFERS)on the 1,890-card board confirmed index scans forcard attachments, comments, checklists, and checklist items. Consolidating the
two checklist counters into one aggregate reduced the representative summary
query from 75.6 to 67.4 ms and from 19,872 to 15,521 shared buffer hits.
Type of change
Checklist
Testing
git diff --check upstream/main...HEADpnpm --filter @kan/api typecheckpnpm --filter @kan/db typecheckpnpm --filter @kan/e2e typecheckpnpm --filter @kan/web test— 8 tests passedpnpm --filter @kan/api test -- board-summary.integration.test.tsboard filters, card move/delete, and card duplication
No screenshots are included because the change does not intentionally alter
the rendered UI.
Linked issue
Not applicable: this is a board loading performance bug fix and does not change
product behavior.