Event Payload Effect

JavaScript performance comparison

Test case created by Flashmattic

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Small Payload
// Create the event.
var event = document.createEvent('CustomEvent');

// Define that the event name is 'build'.
event.initCustomEvent("build", true, true, {
  'id': '14wer5732'
});

// Listen for the event.
document.addEventListener('build', function(e) {
  // e.target matches document from above
}, false);

// target can be any Element or other EventTarget.
document.dispatchEvent(event);
pending…
Big Payload
// Create the event.
var event = document.createEvent('CustomEvent');

// Define that the event name is 'build'.
event.initCustomEvent("build", true, true, {
  "point": {
    "id": "13007",
    "x": 156781.95422096178,
    "y": 99,
    "size": 187214.37850035727,
    "series": 0
  },
  "series": {
    "seriesId": 0,
    "key": "Escalation Team",
    "color": "#0096d6",
    "values": [{
      "id": "13007",
      "x": 156781.95422096178,
      "y": 99,
      "size": 187214.37850035727,
      "series": 0
    }],
    "$$hashKey": "01B"
  },
  "pos": [
    307,
    396
  ],
  "seriesIndex": 0,
  "pointIndex": 0
});

// Listen for the event.
document.addEventListener('build', function(e) {
  // e.target matches document from above
}, false);

// target can be any Element or other EventTarget.
document.dispatchEvent(event);
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 Comments