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

High CPU spikes on MacOS 13.2 #23

Open
kkaczmarczyk opened this issue May 25, 2023 · 5 comments
Open

High CPU spikes on MacOS 13.2 #23

kkaczmarczyk opened this issue May 25, 2023 · 5 comments

Comments

@kkaczmarczyk
Copy link

kkaczmarczyk commented May 25, 2023

Whenever I would type fast there are very high CPU spikes and if I am listening to the music in the background, the music is breaking apart. Happens especially whenever I am using multiple cursors and editing text.
High CPU spikes seems to be related with coreaudiod process.

@mattogodoy
Copy link
Owner

That's a good point. Maybe the extension is playing sounds for every caret in the editor?
I'm sorry to say that I don't have the time to fix it, but I'll gladly review PRs with improvements like this.

@kkaczmarczyk
Copy link
Author

It happens even without multiple cursors - often just fast typing.
Could you suggest place where I can fix it? I can probably make the PR. I enjoy these Fallout keyboard sounds and now I can't use this extension :(

@mattogodoy
Copy link
Owner

The extension already creates only one sound player in memory when loading, so that's already optimized.
For this same reason, sound files are already in WAV format, which is less resource consuming that MP3 files.

I guess that you could find a lighter player, or lower the quality of the wav files, but I suspect this depends highly on the processing power of the computer using the extension. I haven't had this happen to me, even in my old MacBook.

Also, I have not tested this extension very much in Windows or Linux, so it might be that the player we're using for those OSs is not as lightweight as it should.

@kkaczmarczyk
Copy link
Author

Can I try to install a different, more lightweight player for the MacOS though and force extension to use it?

FWIW the memory is alright, only the CPU spikes go above 100%. Unsure why, but maybe some other software interacts with coreaudiod - although the issue is only with the extensions such as this.

@mattogodoy
Copy link
Owner

Sure! We're using the play-sound library for this extension, and as you can see in that link, it allows you to select different players.

You could fork this repo, clone it, test on your local, and if you find a player that works better, you could make a PR with the fixes to this repo, so I could publish the new version of the extension with the fix :)

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

No branches or pull requests

2 participants