Sntls collection iteration

JavaScript performance comparison

Test case created by Dan Stocker

Preparation code

<script src="//dl.dropboxusercontent.com/u/9258903/JavaScript/phil-0.2.2.js"></script>
<script src="//dl.dropboxusercontent.com/u/9258903/JavaScript/dessert-0.3.2.js"></script>
<script src="//dl.dropboxusercontent.com/u/9258903/JavaScript/troop-0.5.1.js"></script>
<script src="//dl.dropboxusercontent.com/u/9258903/JavaScript/sntls-0.13.0.js"></script>
<script src="//dl.dropboxusercontent.com/u/9258903/jsPerf/jorderTest1000.js"></script>
<script>
var collection = sntls.Collection.create(jorderTest1000);
function boundHandler(foo, value, key) {
return foo + value.id;
}
</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
Inline iterator
var foo = 1;
collection.forEachItem(function(value, key) {
return foo + value.id;
});
pending…
Bound iterator
var foo = 1;
collection.forEachItem(boundHandler.bind(this, foo));
pending…

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

Compare results of other browsers

0 comments

Add a comment