Skip to content

A lengthy task in a resource-intensive application. #27770

Closed as not planned
Closed as not planned
@veksa

Description

@veksa

I have a highly-loaded SPA application with frequent store updates and, consequently, a high frequency of interface updates. Calculating data takes a significant amount of time, resulting in a long task of around 70ms. Additionally, due to changes in the pull request - #26512, a microtask is executed with an update, also taking a considerable amount of time.

The total task execution time is 117ms. For me, it would be better to move flushSyncCallbacks into a separate task rather than running it as a microtask.

Is it possible to provide control over scheduling processing? For instance, allowing the replacement of the use of queueMicrotask with something custom, perhaps as a parameter in createRoot, or similar to what is done in react-redux (https://github.com/reduxjs/react-redux/blob/master/src/utils/batch.ts).

I have some ideas for implementation and can create a pull request.

image

React version: 18.2.0

The current behavior

A long task in conjunction with a microtask.

The expected behavior

The code executed in a microtask runs in a separate task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: StaleAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions