SwiftShift icon indicating copy to clipboard operation
SwiftShift copied to clipboard

Potential Performance/Design Issue

Open nmder opened this issue 2 months ago • 5 comments

Hello there,

Thanks for the very nice work!!

One thing that I noticed though is the energy consumption of your app increases as I move my mouse. It seems that the app is always tracking the mouse cursor. Perhaps, It would be better to start tracing when the keybindings are activated.

I might be wrong though. Not a swift expert by any means.

Thanks again!!

nmder avatar Apr 17 '24 19:04 nmder

Hey @nmder! Thanks for opening the issue. Can you let me know how you notice that?

The app is actually only tracking the mouse whenever you press a shortcut. Look at this video of Xcode's builtin energy benchmark. Impact is always ZERO until I resize/move the window (which makes it LOW)

https://github.com/pablopunk/SwiftShift/assets/4324982/bb3e9572-6138-4b2c-baca-13628b67c028

pablopunk avatar Apr 18 '24 09:04 pablopunk

Hi @pablopunk, Thanks for replying! I noticed it at the activity monitor. I can have another look soon and share my findings in a video, as you did.

nmder avatar Apr 18 '24 09:04 nmder

Hi @pablopunk

Please check the video below. Actually, I initially couldn't reproduce it. However, then I rapidly moved a window by holding the keys. Thereafter, I could see the spike in the video without holding the keys.

Hope this helps!

Thanks!

https://github.com/pablopunk/SwiftShift/assets/25340239/32bf79c9-0a3e-4023-87e9-cd037fe597ac

nmder avatar Apr 18 '24 12:04 nmder

@nmder sorry, I tried the same with Activity Monitor and I still get the same behavior as in Xcode. What modifiers are you using as a shortcut? I must be missing something

pablopunk avatar Apr 28 '24 00:04 pablopunk

Hi @pablopunk

I was using left cmd as a modifier to move windows. Cmd + ctrl for resizing.

Thanks!!

nmder avatar Apr 28 '24 03:04 nmder