Skip to content
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

Fix high CPU usage with Safari browsers #114

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

choco
Copy link
Collaborator

@choco choco commented Nov 25, 2021

The high CPU usage when using Shifty with Safari browser comes from:

  • poor scripting bindings in safari (which make every call super expensive)
  • high amount of call (because the notifications we listen to fire too many times)

To address this we can change the notification we listen too, specifically:

  • loadComplete is triggered when a page finishes loading (to handle url change when user is navigating)
  • focusedTabChanges when changing between browser tabs
    We still need to keep uiElementDestroyed to account for when a user leaves a full screen video window.

We also only use the AX api to obtain the URL, which is faster and more lightweight.
I've been using those changes for almost two years so I wouldn't worry about the AX hierarchy stability!

This addresses #101 and #90

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