mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Shave 10 seconds off test runs with DevTools open
Chrome’s “async stack traces” feature makes addEventListener a little slower. DOMBackend’s teardown listeners were causing unnecessary calls to addEventListener in jQuery. Tell jQuery not to do that.
This commit is contained in:
@@ -110,6 +110,12 @@ DOMBackend.Teardown = {
|
||||
};
|
||||
|
||||
$jq.event.special[DOMBackend.Teardown._JQUERY_EVENT_NAME] = {
|
||||
setup: function () {
|
||||
// This "setup" callback is important even though it is empty!
|
||||
// Without it, jQuery will call addEventListener, which is a
|
||||
// performance hit, especially with Chrome's async stack trace
|
||||
// feature enabled.
|
||||
},
|
||||
teardown: function() {
|
||||
var elem = this;
|
||||
var callbacks = elem[DOMBackend.Teardown._CB_PROP];
|
||||
|
||||
Reference in New Issue
Block a user