Skip to content
M

Main Thread Scheduling

Fast and consistently responsive apps using a single function call

by astoilkovFree

#1998in Utilities
0In stores

Description

main-thread-scheduling is a JavaScript library for running heavy work on the main thread without freezing the page. The README says it keeps…

Highlights

  • Runs heavy work on the main thread without freezing the UI
  • yieldOrContinue(strategy) covers most cases
  • Tasks sorted by strategy, with idle tasks run last
  • Pauses work while the user interacts
  • One global queue for background tasks

Ratings & Reviews

No ratings yet

Be the first to rate Main Thread Scheduling.

People also visit

F

flutter-handling-concurrency

Executes long-running tasks in background isolates to keep the UI responsive

AI Skills
Get
P

Partytown

Relocate resource intensive third-party scripts off of the main thread

Productivity
Launch
S

Schedule

Schedule timing task in Swift using a fluent API

Utilities
Launch
P

Parallel DOM

Parallelize heavy DOM operations, workers concurrency

Developer Tools
Launch
P

Poolifier

Fast and small Node.js worker_threads and cluster worker pool

Utilities
Launch
S

Sidequest.js

Redis-free background jobs for Node.js

Utilities
Launch

Main Thread Scheduling FAQ

What is main-thread-scheduling for?

Running heavy JavaScript work in small pieces so the page stays responsive.

What is the main function?

yieldOrContinue(strategy). The README says it covers about 90 percent of cases, and the other two functions are for advanced use.

How does it keep input responsive?

It stops running tasks when the user interacts with the UI, if the browser provides navigator.scheduling.isInputPending().

Which browser APIs does it use?

requestIdleCallback and requestAfterFrame for scheduling the work.

Does adding more tasks slow things down?

The README says tasks run one by one from a shared queue, so adding more tasks does not degrade performance in a straight line.

What are the best Main Thread Scheduling alternatives?

Popular alternatives to Main Thread Scheduling include Schedule, Poolifier and Sidequest.js. See all Main Thread Scheduling alternatives

Developer Stuff

Badges