wqfwewefewrw

JavaScript performance comparison

Revision 15 of this test case created by

Preparation code

<script src="https://rawgithub.com/kriskowal/q/master/q.js"></script>

<script src="https://rawgithub.com/rkatic/p/master/p.js"></script>

<script src="https://rawgithub.com/curvedmark/promise-now/master/promise-now.js"></script>

    <script>
        define = function( factory ) {
            when = factory();
        };
        define.amd = {};
    </script>
<script src="https://rawgithub.com/cujojs/when/master/when.js"></script>


      
<script>
Benchmark.prototype.setup = function() {
  function addOne(x) {
  	return x + 1;
  }
  
  Q.longStackJumpLimit = 0;

};
</script>

Preparation code output

<script src="https://rawgithub.com/rkatic/p/master/p.js"></script> <script src="https://rawgithub.com/curvedmark/promise-now/master/promise-now.js"></script> <script> define = function( factory ) { when = factory(); }; define.amd = {}; </script> <script src="https://rawgithub.com/cujojs/when/master/when.js"></script>

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
Q
var d = Q.defer();
d.promise.then(addOne);
d.resolve(1);
pending…
when
var d = when.defer();
d.promise.then(addOne);
d.resolve(1);
pending…
P
var d = P.defer();
d.promise.then(addOne);
d.resolve(1);
pending…
Promise Now
var promise = new Promise();
promise.then(addOne);
promise.fulfill(1);
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.

0 Comments