parall threads (v4)

Revision 4 of this benchmark created by Calvin on


Description

parallel.js vs communist.js this is a 'unfair test' that uses both libraries idomatically, which will give a massive boost to communist.

Preparation HTML

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

Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
communist
// async test
w.batch.data(a).then(function(){deferred.resolve()});
ready
paralell
// async test
var p = new Parallel(a);
p.map(square).then(function(){deferred.resolve()});
ready

Revisions

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