Comments (4)
Wild idea, but would is be possible to do something like extend the delay adaptively? RIC does this but it's often too fast.
I've used algorithms that are able to calculate current CPU pressure. I mainly do this so I can block third party tags by monkey patching document.createElement. Then based of CPU pressure I can suspend the unblock rates till CPU isn't under so much stress.
Another one that might be interesting to consider is suspending when the user interacts with the page, scrolling or clicking around - tho some of this might be covered by by requestAnimationFrame
from main-thread-scheduling.
Wild idea, but would is be possible to do something like extend the delay adaptively?
I like the idea. Maybe I can use it as a fallback when navigator.scheduling.isInputPending()
isn't available. Do you have examples of a code that tries to do that? I will be interested in learning from it.
Another one that might be interesting to consider is suspending when the user interacts with the page, scrolling or clicking around - tho some of this might be covered by requestAnimationFrame
This is covered by navigator.scheduling.isInputPending()
when available. When not available the library is a lot more conservative to do work without giving back control to userland.
from main-thread-scheduling.
Wild idea, but would is be possible to do something like extend the delay adaptively?
I started experimenting with this. We will see how it goes.
I've used algorithms that are able to calculate current CPU pressure. I mainly do this so I can block third party tags by monkey patching document.createElement. Then based of CPU pressure I can suspend the unblock rates till CPU isn't under so much stress.
Is some part of that open-source? I would love to take inspiration.
from main-thread-scheduling.
My current idea is to use fps
tracking: https://github.com/astoilkov/main-thread-scheduling/blob/980ad69b477779ff882eac16ac7cd2a60331e16c/playground/utils/fps.ts. If fps
is low, I will spend less time in scheduled tasks. I will add an option to the yield methods where you can control the wiggle room in ms. What do you think @ScriptedAlchemy?
from main-thread-scheduling.
Related Issues (14)
- callback based API HOT 3
- Can't find the effect. HOT 3
- Error when building a project with Vite HOT 2
- Stand-alone JS file? HOT 4
- interrupt the rendering of react HOT 3
- Any GC concerns when using async/await HOT 2
- Donβt crash SSR HOT 6
- Possible to manually cancel a scheduled function HOT 3
- Support for postTask scheduling? HOT 2
- Easier web workers HOT 8
- Compile errors in v6.0.0 HOT 2
- Comparisson with other frameworks HOT 6
- Can it be used in vue3 οΌ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from main-thread-scheduling.