-
Notifications
You must be signed in to change notification settings - Fork 49.3k
Description
The document-wide handlers for native events that perform synthetic event dispatch execute in 0.2-0.7 milliseconds on my machine. I realize this doesn't seem like much time, but we're really trying to shave off any non-essential source of latency for typing and cursor movement in Atom, and every little bit helps. Disabling synthetic events on keydown
and textinput
is saving about 1ms of latency for a keystroke.
In our fork, I've added the ability to add a reactSkipEventDispatch
property to the native event to opt out of synthetic dispatch, but I'd be interested in a more official mechanism for opting out of this feature for certain event types. Even better, perhaps React could maintain a cache of what event types are actually being listened for and bail out as soon as possible if handling an event.