wqfwewefewrw

JavaScript performance comparison

Revision 18 of this test case created

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/browser/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

Test runner

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

Java applet disabled.

Testing in unknown unknown
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. Here’s a list of current revisions for this page:

0 comments

Add a comment