Consider avoiding timers/promises where possible.
See original GitHub issueHey there, great library! I’ve been having a great time using it so far and I hope I can help contribute some stuff back.
Anyways, I learned to my dismay today that Chrome will delay timers that it thinks will take a long time to load.
In my profiling with a very tall Grid, this can cause multi seconds delays.
The chunk starting at 5500ms is the promise returned from loadMoreRows
finally resolving (~2.5s late) and the _debounceScrollEndedCallback
finally being called (~1.5s late)
I haven’t tested this yet, but I think if loadMoreRows was notified via callback instead of Promise it could be force updated much sooner. I’ll do some actual testing tomorrow. Thoughts on the feasibility of this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:20 (18 by maintainers)
Top Results From Across the Web
Timers | Node.js v19.3.0 Documentation
If callback is not a function, a TypeError will be thrown. This method has a custom variant for promises that is available using...
Read more >Promise microtask scheduling can create starvation · Issue #25
I believe this betrays a fundamental mis-design in promises, in that they didn't specify that the microtask queue has to prevent starvation ...
Read more >Optimise Node.js performance by avoiding broken promises
An in-depth look at promises, the Node.js event loop and developing successful strategies for building highly performant Node.js ...
Read more >Jest: Timer and Promise don't work well. (setTimeout and ...
Basically the action won't resolve unless the timer advances. Feels like a circular dependency here: promise need timer to advance to resolve, ...
Read more >Never Mix Promises and Callbacks in NodeJS - Atomic Spin
Also, watch out for Sinon's useFakeTimers() . The asCallback method uses timers to escape the promises, and useFakeTimers() makes timer code ...
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
requestAnimationFrame 👍
hope this eventually go into the lib, since those ~2 second delays are driving crazy