question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider avoiding timers/promises where possible.

See original GitHub issue

Hey 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.

screen shot 2017-01-05 at 8 05 16 pm

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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Feb 6, 2017

requestAnimationFrame 👍

0reactions
estorskicommented, Jun 13, 2017

hope this eventually go into the lib, since those ~2 second delays are driving crazy

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found