microsoft / microsoft/react-native-windows
Change `BatchingQueueCallInvoker` to re-use task queue for each batch
@vmoroz is already working on this.
Since Jun 29, 2023.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.