xnotify

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"></script>
<script src="//pinesframework.org/pnotify/jquery.pnotify.js"></script>
<script>
Benchmark.prototype.setup = function() {
    function replaceIcon(el, o) {
      if (o.iconPath) {
        el.find('.ui-pnotify-icon').addClass(o.icon).html($('<img>', {
          src: o.iconPath,
          'class': 'notifyImage'
        }));
      }
      return el;
   
    }
   
    function replaceIcon2(el, o) {
      if (o.iconPath) {
        el.find('.ui-pnotify-icon').css({
          color: '#asdasd',
          'background-image': 'asd'
        });
      }
      return el;
   
    }
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
a
replaceIcon($.pnotify({
  title: "foo"
}), {
  o: {
    iconPath: "jkj"
  }
})
pending…
b
replaceIcon2($.pnotify({
  title: "foo"
}), {
  o: {
    iconPath: "jkj"
  }
})
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

Add a comment