Replies: 1 comment
-
I looked around for other open-source libraries and found timer-wheel on npm which implements an expiry data structure that appears high quality and fulfills our needs. We could implement a
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm investigating adopting tanstack/query in a large production application called Notion. We need to support tens of thousands of queries on screen at once. I'm concerned that the current implementation of query GC uses individual setTimeout per query. This means after a navigation, tanstack/query-core would call
setTimeout
tens of thousands of times, which can cause a lot of event loop delay.Our solution to this issue with our current internal system is to use a very simple timer coalescing with a scheduler, so instead of 30k setTimeout calls, we have either 0 or 1 calls to setInterval. It would be great to update Removable#scheduleGc to do its scheduling via something like
TimeoutGroup
, similar to how the system usesnotifyManager
. Pseudocode below:to avoid huge event loop delay after navigation unmounts a bunch of QueryObservers.
Beta Was this translation helpful? Give feedback.
All reactions