Remove jQuery.event.fix performance bottleneck #3103

Closed
dmethvin opened this Issue May 3, 2016 · 0 comments

Projects

None yet

2 participants

@dmethvin
Member
dmethvin commented May 3, 2016

Every native event has to go through jQuery.event.fix() to copy and normalize properties that go into the jQuery.Event object passed to handlers. There is a tension between minimizing the number of items copied for performance reasons versus making more of them available directly so that users won't be forced to get them via event.originalEvent.

See further discussion in gh-2860 and gh-1746.

@dmethvin dmethvin added a commit that closed this issue May 4, 2016
@jbedard @dmethvin jbedard + dmethvin Event: Remove fixHooks, propHooks; switch to ES5 getter with addProp
Fixes gh-3103
Fixes gh-1746
Closes gh-2860

- Removes the copy loop in jQuery.event.fix
- Avoids accessing properties such as client/offset/page/screen X/Y
  which may cause style recalc or layouts
- Simplifies adding property hooks to event object
e61fccb
@dmethvin dmethvin closed this in e61fccb May 4, 2016
@dmethvin dmethvin added this to the 3.0.0 milestone May 6, 2016
@jbedard jbedard was assigned by dmethvin May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment