Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the issue #5189 #5209

Merged
merged 1 commit into from
Oct 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/renderers/shared/event/EventPluginHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
var EventPluginRegistry = require('EventPluginRegistry');
var EventPluginUtils = require('EventPluginUtils');
var ReactErrorUtils = require('ReactErrorUtils');
var ReactPerf = require('ReactPerf');

var accumulateInto = require('accumulateInto');
var forEachAccumulated = require('forEachAccumulated');
Expand Down Expand Up @@ -308,9 +307,4 @@ var EventPluginHub = {

};

ReactPerf.measureMethods(EventPluginHub, 'EventPluginHub', {
putListener: 'putListener',
deleteListener: 'deleteListener',
});

module.exports = EventPluginHub;
1 change: 0 additions & 1 deletion src/test/ReactDefaultPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ var ReactDefaultPerf = {
].totalTime = performanceNow() - start;
return rv;
} else if (fnName === '_mountImageIntoNode' ||
moduleName === 'EventPluginHub' ||
moduleName === 'ReactDOMIDOperations' ||
moduleName === 'CSSPropertyOperations' ||
moduleName === 'DOMChildrenOperations' ||
Expand Down
32 changes: 24 additions & 8 deletions src/test/__tests__/ReactDefaultPerf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('ReactDefaultPerf', function() {
var ReactDOM;
var ReactDefaultPerf;
var ReactTestUtils;
var ReactDefaultPerfAnalysis;

var App;
var Box;
Expand All @@ -31,6 +32,7 @@ describe('ReactDefaultPerf', function() {
ReactDOM = require('ReactDOM');
ReactDefaultPerf = require('ReactDefaultPerf');
ReactTestUtils = require('ReactTestUtils');
ReactDefaultPerfAnalysis = require('ReactDefaultPerfAnalysis');

App = React.createClass({
render: function() {
Expand Down Expand Up @@ -142,14 +144,6 @@ describe('ReactDefaultPerf', function() {
});
});

it('should not count listener update as waste', function() {
var container = document.createElement('div');
ReactDOM.render(<Div onClick={function() {}}>hey</Div>, container);
expectNoWaste(() => {
ReactDOM.render(<Div onClick={function() {}}>hey</Div>, container);
});
});

it('should not count property removal as waste', function() {
var container = document.createElement('div');
ReactDOM.render(<Div className="yellow">hey</Div>, container);
Expand Down Expand Up @@ -188,4 +182,26 @@ describe('ReactDefaultPerf', function() {
});
});

it('putListener should not be instrumented', function() {
var container = document.createElement('div');
ReactDOM.render(<Div onClick={function() {}}>hey</Div>, container);
var measurements = measure(() => {
ReactDOM.render(<Div onClick={function() {}}>hey</Div>, container);
});

var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
expect(summary).toEqual([]);
});

it('deleteListener should not be instrumented', function() {
var container = document.createElement('div');
ReactDOM.render(<Div onClick={function() {}}>hey</Div>, container);
var measurements = measure(() => {
ReactDOM.render(<Div>hey</Div>, container);
});

var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
expect(summary).toEqual([]);
});

});