imsky / imsky/holder

high cpu usage

Open
#229 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

On my machine, there is high cpu usage on pages that use holder. Traced it back to these lines in index:

```
// Done to prevent 100% CPU usage via aggressive calling of requestAnimationFrame
setTimeout(function () {
global.requestAnimationFrame(visibilityCheck);
}, 10);
```

Since this is a recursive call, can we only make these calls on DOM changes? Or pehaps a way for the developer to turn off the timeout, and manually call Holder when a change has occurred.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in index at the setTimeout/requestAnimationFrame recursion around visibilityCheck and reproduce the high CPU usage on a page using Holder. Compare the reported continuous checks with the requested DOM-change or manual-update behavior; done means the excessive CPU use is resolved without breaking placeholder updates. No test file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.