[Bug]: High CPU Usage #3216
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#3216
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Preflight Checklist
YouTube Music (Application) Version
3.8.0
Checklists
What operating system are you using?
macOS
Operating System Version
macOS 15.3.2
What CPU architecture are you using?
arm64 (including Apple Silicon)
Last Known Working YouTube Music (Application) version
3.7.0
Reproduction steps
Due to this even basic functions like play/ pause are taking minutes making it unusable.
I've disabled almost all the plugins. The enabled plugins are :
Expected Behavior
YT Music should not consume these many resources and work lag free.
Actual Behavior
App freezes
Enabled plugins
Added above
Additional Information
No response
Can you reproduce this issue at 3.7.x?
And, can you disable adblock plugin?
The CPU is still high with Adblock disabled on 3.8.0
On 3.7.5 (without adblock), The startup load is high for a minute and then settles to <20% load
Similar behaviour with adblocker enabled on 3.7.5.
Same as @Akv2021, Macbook Air M2. Did this project ported to Mac ARM through Rosetta?
@dangnhdev No, this project supports Apple Silicon natively.
On M1 pro it is super slow. All the plugins is turned off. Previous version had no such issue until upgrade, I've tried to install it back but unfortunately it don't play anything anymore. I've tried to compile from master, but it fails.
@ajiekc905
Perhaps this issue is caused by a bug in electron v35? Could you check if the same symptoms occur after changing the electron version to 34.3.0?
Also, has this issue been resolved in electron v35.2.0? https://github.com/electron/electron/pull/46615
Sorry, how do I properly compile the project? Npm start seem to throw plenty of errors like:
npm start
vite v6.2.5 building SSR bundle for production...
node_modules/file-type/core.js (1419:16): Use of eval in "node_modules/file-type/core.js" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 3285 modules transformed.
dist/main/index.js 6,700.32 kB
✓ built in 10.53s
vite v6.2.5 building SSR bundle for production...
✓ 384 modules transformed.
dist/preload/preload.js 1,194.50 kB
✓ built in 4.30s
vite v6.2.5 building for production...
✓ 334 modules transformed.
No name was provided for external module "path" in "output.globals" – guessing "require$$0$2".
Creating a browser bundle that depends on Node.js built-in modules ("path"). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node
../dist/renderer/index.html 0.48 kB
../dist/renderer/youtube-music.iife.js 9,460.68 kB
✓ built in 23.66s
start electron app...
(node:95662) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead.(Use
Electron --trace-deprecation ...
to show where the warning was created)[YTMusic] i18n loaded
[YTMusic] Loading all plugins
[YTMusic] Plugin api-server::backend executed at 1.86ms
[YTMusic] Plugin downloader::backend executed at 1064.45ms
[YTMusic] Plugin "downloader::menu" loaded
[YTMusic] Plugin "api-server::menu" loaded
[YTMusic] Plugin "downloader::menu" loaded
[YTMusic] Plugin "api-server::menu" loaded
[95662:0422/201704.836973:ERROR:platform_util_mac.mm(258)] Unable to set login item: The operation couldn’t be completed. Operation not permitted
[YTMusic] Finished loading. DevTools opened
[95662:0422/201708.590737:ERROR:CONSOLE(1)] "Request Autofill.enable failed. {"code":-32601,"message":"'Autofill.enable' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[95662:0422/201708.590794:ERROR:CONSOLE(1)] "Request Autofill.setAddresses failed. {"code":-32601,"message":"'Autofill.setAddresses' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
2025-04-22 20:17:08.656 Electron[95662:17841429] +[IMKClient subclass]: chose IMKClient_Modern
[95662:0422/201709.051827:ERROR:CONSOLE(1)] "Request Autofill.enable failed. {"code":-32601,"message":"'Autofill.enable' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
[95662:0422/201709.051900:ERROR:CONSOLE(1)] "Request Autofill.setAddresses failed. {"code":-32601,"message":"'Autofill.setAddresses' wasn't found"}", source: devtools://devtools/bundled/core/protocol_client/protocol_client.js (1)
On the electron Dev console:
Uncaught ReferenceError: require$$0$2 is not defined
at youtube-music.iife.js:159465:1548
VM120 preload.js:75 Uncaught (in promise) Error: Script failed to execute, this normally means an error was thrown. Check the renderer console for the error.
at Object. (VM120 preload.js:75:5817)
at Object. (VM120 preload.js:77:3)
at Module._compile (VM63 loader:1569:14)
at Module._extensions..js (VM63 loader:1722:10)
at Module.load (VM63 loader:1296:32)
at Module._load (VM63 loader:1115:12)
at c._load (VM77 node_init:2:17950)
at s._load (VM118 renderer_init:2:31718)
at VM118 renderer_init:2:33787
at VM118 renderer_init:2:34256
music_polymer_inlined_html.js:4743 LegacyDataMixin will be applied to all legacy elements.
Set
_legacyUndefinedCheck: true
on element class to enable.The same is happening to me with 3.8.0 on Mac
It works fine on 3.7.5
might be related but each song takes so long to start and finish. navigating to library also takes forever. i have a macbook air m1. 3.7.5 is also fine for me.
Still reproducible in v3.8.1?
@ariyin @kyotocafe @ajiekc905
yes, i think it might be a bit better but i'm not sure. it took ~10min from clicking the application to it opening and loading the screen + songs. it'll randomly pause in the songs it's playing and take a bit to transition from one song to the other (but might be a bit shorter than in v3.8.0). clicking buttons to navigates takes like 30 seconds but it eventually loads.
Still reproducible in v3.9.0?
@ariyin @kyotocafe @ajiekc905
working well for me now! thank you!
Working almost as fast as 3.7.x
Largest Contentful Paint (LCP)
36.31 s
Your local LCP value of 36.31 s is poor. From the performance tab. On the first run it was 70s (m1 Pro 64gb).
I think it's a bug in electron v35
Keep tracked at #3292