Angular Calendar Events Fingerprint

JavaScript performance comparison

Test case created by Gleb Mazovetskiy

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var events = [];
    for (var i = 0; i < 1000; i++) {
      var e = {};
      e.title = "Test event";
      e.start = new Date();
      e.end  = new Date();
      events.push(e);
    }
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Attr.join()
var fingerprint = (function() {
  var fpn = [];
  for (var i = 0, n = events.length; i < n; i++) {
    var e = events[i];
    fpn.push(e.id, e.title, e.url, e.start, e.end, e.allDay);
  }
  return fpn.join("")
})();
(fingerprint == fingerprint);
pending…
"" + attr1 + attr2 ...
var fingerprint = (function() {
  var fpn = "";
  for (var i = 0, n = events.length; i < n; i++) {
    var e = events[i];
    fpn = fpn + e.id + e.title + e.url + e.start + e.end + e.allDay;
  }
  return fpn;
})();
(fingerprint == fingerprint);
pending…
"".concat(attr1, attr2, ...)
var fingerprint = (function() {
  var fpn = "";
  for (var i = 0, n = events.length; i < n; i++) {
    var e = events[i];
    fpn = fpn.concat(e.id, e.title, e.url, e.start, e.end, e.allDay);
  }
  return fpn;
})();
(fingerprint == fingerprint);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment