perf: reduce Market table resize rerenders#12476
Draft
huhuanming wants to merge 1 commit into
Draft
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.
What changed
gtLgandgtXlbreakpoints, then filter only the active 8/9/11-column set.MemoTableCell, allowing unchanged cells to skip React and Tamagui style resolution when a responsive column is added.Why
The previous
mdresize case replaced the desktop/mobile shell, so it was not a fair measure of Market list performance. The corrected benchmark keeps the desktop shell stable and measures the real 8 -> 9 column transition around 1024 px.At the breakpoint,
useColumnsDesktop()previously rebuilt every column descriptor. Each memoized row received a new columns array and reconstructed every existing cell, causing repeated React work and deep Tamagui style resolution.Impact
Production build, three-run median, 20 measured transitions per scenario:
The equal-distance non-breakpoint control scripting time also improved by 15.3%. Visible behavior remains 8 columns below 1024 px, 9 columns at
gtLg, and 11 columns atgtXl. Hidden columns are not kept mounted.Validation
yarn agent:check --profile commitgit diff --checkTwo alternatives that kept all 11 cells mounted using Tamagui responsive props or native CSS media classes were measured, regressed performance, and were reverted.