perf(menubar): skip unchanged native tray work - #561
Closed
JustYannicc wants to merge 71 commits into
Closed
Conversation
(cherry picked from commit fb7405f)
(cherry picked from commit 290a0f5)
(cherry picked from commit 3739cb0)
(cherry picked from commit c78d0b9)
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime-renderers.tsx # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack # Conflicts: # src/renderer/src/CameraExtension.tsx
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack
…ated-integration-stack
… into codex/perf-consolidated-integration-stack
Collaborator
Author
|
Superseded by consolidated lifecycle/media wave-2 PR: #575 |
Collaborator
Author
|
Closing as superseded by #575. |
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
Menu.buildFromTemplateandtray.setContextMenuwhen serializeditemsare unchanged.menubar-removeand inwill-quitalongside tray/image cache teardown.Why
Timer-like menu-bar extensions often send accepted payloads for title text changes while their native menu items remain identical. Rebuilding the Electron menu template and context menu every tick adds native work without changing click routing, because menu clicks still send the same item IDs to the renderer's current action map.
Compatibility impact
First payload creation, incomplete first icons, fallback icons/titles, emoji icons, disabled items, submenus, and serialized alternates keep their existing behavior. Empty tooltip payloads remain non-clearing. File-backed tray icons still refresh on accepted payloads so on-disk icon identity changes can be picked up.
How tested
node --test scripts/test-menubar-native-update-cache.mjsnode --test scripts/test-menubar-native-image-cache.mjsnode --test scripts/test-menubar-payload-cache.mjsnpm run build:mainnpm testlsp.statuslsp.diagnosticswithseverity: "error"onsrc/main/main.tsandsrc/main/menubar-native-update-cache.tsPerformance evidence
The new native update counter test models 60 accepted title ticks with unchanged serialized items. Before this change, that path performs 60
Menu.buildFromTemplatecalls and 60setContextMenucalls; after this change, it performs 1 of each. Existing native image cache evidence still reports repeated accepted payload decode/read/resize work reduced from 1620 operations to 81 over 20 updates.Stack validation
Started from integration base
264fb89dc5c867d6c3d77bc4b95e26e235e326eaon stack branchfork/codex/perf-consolidated-integration-stack; before editing,HEADand the stack branch both resolved to that commit.Replaces
None