[BUG] checkIfDefined is doing nothing but wasting CPU
See original GitHub issueDescribe the bug
The current implementation can and is endlessly looping so long the elements are not defined which in some cases won’t be and due to the logic used in this function it will somehow use noticeable (on low-medium spec CPU) CPU Utilization.
Steps to reproduce
- Go to mail.google.com
- Open performance tab in Dev tools
- Get a fresh performance
ctrl +e
after the page has been fully loaded. - See that even that checkIfDefined is still being called in a animationFrame alongside checkForUpdate(expected)
Expected behavior
Not using CPU or some other implementation to prevent this, not even sure what :defined
has to do with Shadow DOM’s.
Actual behavior
It’s using CPU utilization even in idle
when not needed
System Information:
- OS: Windows 10
- Browser: Vivaldi(3.4.2066.76)
- Dark Reader version: 4.9.21
Additional context
More info about this https://github.com/darkreader/darkreader/issues/3811#issuecomment-712695274
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
C Main Loop without 100% cpu - Stack Overflow
If you are doing something useful (i.e. processing a lot of data), then 100% cpu load just means that the processor is used...
Read more >[Solved] System Interrupts High CPU Usage on Windows 10
If you find System interrupts keep taking up over 20% of CPU usage, it means there's something error with your hardware or the...
Read more >How to Fix High CPU Usage in Windows - AVG
Long-term high CPU usage (say 90-100%) can cause computer freezes & crashes. Find the cause and fix high CPU usage on Windows today....
Read more >How to Fix High CPU Usage - Intel
Find out all the reasons why your PC displays high CPU usage. Our step-by-step guide will show you how to fix your CPU...
Read more >Troubleshooting High CPU Utilization - Cisco
In the stacked switch, the CPU utilization is measured on the master switch only. If the CPU is busy 5% of the time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Lot of work! Thank you!
@ddnexus #4005