deferred-vs-promise

Benchmark created by rmunson on


Preparation HTML

<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Deferred
var def=$.Deferred();
def.then(function(thing){  return thing}).then(function(thing){ return thing});
def.resolve(true);
ready
Promise
var prom=new Promise(function(resolver){ resolver(true)});
prom.then(function(thing){  return thing}).then(function(thing){ return thing});
 
ready

Revisions

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

  • Revision 1: published by rmunson on