microsoft / microsoft/react-native-windows

Change `BatchingQueueCallInvoker` to re-use task queue for each batch

Open
#11,779 2 comments 0 reactions 1 assignee View on GitHub

@vmoroz is already working on this.

Since Jun 29, 2023.

enhancement Partner: Microsoft Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Summary

Right now, BatchingQueueCallInvoker creates a std::vector with initial capacity of 2048 elements to store the batch of tasks that will eventually be std::moved to the UI thread to be processed.

Instead of allocating and moving the vector each time, instead find a way of reusing the vector.

Motivation

Some internal partners have automated testing to catch memory leaks using memory-constrained environments, which catch OOM errors during memory allocations. Despite not being a leak, and its relatively small size, the constant (re-)allocation of this vector means it often triggers the OOM and gets blamed for others' leaks.

Finding a way to prevent the constant allocation would allow any actual leaks to be correctly root caused and reduce the noise blaming RNW.

Basic Example

No response

Open Questions

Since the tasks need to be moved onto the UI thread, is it even possible to do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.