-
Notifications
You must be signed in to change notification settings - Fork 46
🤖 perf: cut DiffRenderer O(lines) tooltip/icon cost #2079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I reproduced two issues you found and pushed a fix:
Patch: make hover detection work for Text node targets, and toggle the overlay button via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d33f2e6bbc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Pushed another iteration to address the two regressions:
Also hardened the delegated hover target lookup to avoid |
|
@codex review Addressed the Makefile Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 775091b720
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| npm x concurrently -k --raw \ | ||
| "bun x nodemon --watch src --watch tsconfig.main.json --watch tsconfig.json --ext ts,tsx,json --ignore dist --ignore node_modules --exec node scripts/build-main-watch.js" \ | ||
| 'npx esbuild src/cli/api.ts $(ESBUILD_CLI_FLAGS) --watch' \ | ||
| "VITE_MUX_FAST_DEV=1 vite --mode fast" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Windows-safe env syntax for dev-fast
On Windows, concurrently runs commands via cmd.exe, which doesn’t understand Unix-style VAR=... prefixes. The dev-fast Windows target uses VITE_MUX_FAST_DEV=1 vite --mode fast, so the command fails (or the env var is never set), breaking dev-fast on Windows. Use set VITE_MUX_FAST_DEV=1&& vite --mode fast (or cross-env) or set the env var on the outer concurrently invocation.
Useful? React with 👍 / 👎.
Stop positioning the shared review-comment button via rect math. Instead portal a single button into the hovered indicator cell, and keep it in sync while scrolling via elementFromPoint(). --- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: `$15.86`_ <!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=15.86 -->
Summary
This PR reduces renderer allocations when viewing large code-review diffs by removing O(lines) tooltip/icon subtrees from
SelectableDiffRenderer, replacing them with a single hover-positioned “add review comment” affordance and event delegation. It also adds an opt-inmake dev-fastmode to profile dev builds closer to production.Background
A heap profile (captured Jan 18, 2026) showed
DiffRenderer.tsx, Radix Tooltip, andlucide-reactas major allocation sources (amplified in dev viajsxDEV+StrictMode).Implementation
MessageSquareicons.mouseover(notmousemove) so it appears immediately on entry.contentProps/contentRefhooks and make the inner gridrelativeso overlays can be anchored reliably.make dev-fast(Vite--mode fast) +VITE_MUX_FAST_DEV=1to disableStrictMode, avoidjsxDEV, and disable React Refresh.Validation
make static-checkRisks
Generated with
mux• Model:openai:gpt-5.2• Thinking:xhigh• Cost:$10.49