facebook/react — pull request #1612 by syranide (2014-05-27 22:01:56+00:00)
Title: RFC Remove event pooling

I couldn't really find anyone on IRC who *really* knew why we do this. It's annoying to debug and people often don't understand what's happening.

I understand the idea of decreasing the pressure on the GC, but I fail to see how pooling events is going to matter, we're talking worst-case of a consistent stream of about 2 events per render (give or take, or?). If all we do is dispatch events and there is no render, any pressure on the GC should be imperceptible and any half-decent GC shouldn't find it hard to deal short-lived objects. If any of those update an immutable store we're going to see a handful of objects get created and unreferenced, if any of those cause a React render, we might be seeing hundreds of objects get created and unreferenced.

For internal classes, pooling is great no matter what really, but we're talking about a public API that's also rather common and standardized. This is not intuitive behavior and so event pooling comes at a great cost, but from where I'm standing there doesn't seem to be an equal or greater benefit.

PS. Only after doing this PR did I discover that there actually was a `event.persist()` method, if we stick to pooled events, we *really* should document it definitely makes it less sucky.

PS2. PR because I can, not because I care :)