dillon1000/react

Commit

Fix a few GC leaks in events system

Summary:
    - Weren't pooling the Transaction in the batching strategy
    - Creating a new closure for every event tick due to batchedUpdates()
    - EnterLeaveEventPlugin creates a new array on each event.

I wonder if there is more optimization opportunity in accumulate(). Squinting at the fps graph this seems to be faster and waste less memory but it's hard to conclusively tell. I did verify that these were all hotspots though.
Browse files
Changed paths4 files
First-parent comparison
M src/core/ReactDefaultBatchingStrategy.js ModifiedM src/core/ReactEventEmitterMixin.js ModifiedM src/core/ReactUpdates.js ModifiedM src/eventPlugins/EnterLeaveEventPlugin.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…