Skip to content

Fix event processing performance regressions - #1170

Merged
lujjjh merged 2 commits into
mainfrom
fix/1166-1168-event-performance
Apr 25, 2026
Merged

lujjjh merged 2 commits into
mainfrom
fix/1166-1168-event-performance

Conversation

@lujjjh

@lujjjh lujjjh commented Apr 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • reduce idle CPU usage from Logitech receiver/control monitoring by avoiding fixed 10ms polling loops and starting the Logitech controls monitor only when needed
  • avoid resolving the mouse-location window owner when no scheme uses process conditions
  • cache short-lived CGWindowList snapshots for process-conditioned schemes to reduce topmost window owner lookup cost during high-frequency mouse movement

Testing

  • xcodebuild -project LinearMouse.xcodeproj -scheme LinearMouse -configuration Debug -destination 'platform=macOS' build
  • xcodebuild -project LinearMouse.xcodeproj -scheme LinearMouse -destination 'platform=macOS' -only-testing:LinearMouseUnitTests/ConfigurationTests/testUsesProcessConditions test

Related to #1166, #1168

lujjjh and others added 2 commits April 25, 2026 12:53
Avoid resolving the mouse-location window owner when no scheme uses process conditions, and cache short-lived CGWindowList snapshots for the remaining cases.

Co-authored-by: Zoltán Szepesi <[email protected]>
@lujjjh
lujjjh merged commit 4dafebd into main Apr 25, 2026
1 check passed
@lujjjh
lujjjh deleted the fix/1166-1168-event-performance branch April 25, 2026 06:15
lujjjh added a commit that referenced this pull request Apr 25, 2026
## Summary
- keep Logitech control handling on the same topmost-window owner lookup
path used before the performance gate, since Logitech control
notifications are not the high-frequency mouse-move hot path
- preserve universal back/forward behavior for Logitech control mappings
without changing the event tap optimization from #1170
- keep Logitech control events and mouse-move events on the same
transformer cache key when process conditions are not used, so Logitech
gesture tracking keeps its movement state
- remove the unused timeout parameter from the synchronous GetReport
helper, since that path performs a single synchronous
`IOHIDDeviceGetReport` call

## Testing
- `xcodebuild -project LinearMouse.xcodeproj -scheme LinearMouse
-configuration Debug -destination 'platform=macOS' build`\n
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