parall threads (v12)

Revision 12 of this benchmark created on


Description

parallel.js vs communist.js with communist just both like parallel and like I intended it to be used.

Preparation HTML

<script src="https://rawgithub.com/adambom/parallel.js/master/lib/parallel.js"></script><script src="https://rawgithub.com/calvinmetcalf/catiline/master/dist/catiline.min.js"></script>
<script>
var square = function (n) { 
    return n * n;
};
var w = communist({data:square},4);
var dc = communist({data:square},4,true);
</script>

Setup

var a = [];
    while(a.length<50){
    a.push( Math.random()*100);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
paralell
// async test
(new Parallel(a)).map(square).then(function(){deferred.resolve()});
ready
communist parallel style
// async test
var ww = communist({data:square},4);
ww.batch.data(a).then(function(){return ww.close()}).then(function(){deferred.resolve()});
ready
communist idiomatic
// async test
w.batch.data(a).then(function(){deferred.resolve()});
ready
communist dumb queue parallel style
// async test
var dp = communist({data:square},4,true);
dp.batch.data(a).then(function(){return dp.close()}).then(function(){deferred.resolve()});
ready
communist idomatic dumb queue
// async test
dc.batch.data(a).then(function(){deferred.resolve()});
ready

Revisions

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