Event Payload Effect

Benchmark created by Flashmattic on


Description

How does the size and volume of a simple event payload effects preformance

Test runner

Ready to run.

Testing in
TestOps/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);
ready
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);
ready

Revisions

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

  • Revision 1: published by Flashmattic on