Filtering Methods
JavaScript performance comparison
Preparation code
<script src="https://github.com/documentcloud/underscore/raw/master/underscore-min.js">
</script>
<script>
Benchmark.prototype.setup = function() {
var arrOfEl = ['jason', 'jason', 'jason', 'james', 'james', 'jason', 'james', 'johan', 'jonah', 'jason', 'james', 'james', 'james', 'john', 'johan', 'james', 'jason', 'jonah', 'jason', 'james', 'jack', 'jolly', 'jalop', 'johan', 'jonah', 'james', 'jeckyll', 'jack', 'johny', 'jockey', 'jockey', 'joke', 'joke', 'jonah', 'jason', 'james'];
var len = arrOfEl.length - 1;
};
Benchmark.prototype.teardown = function() {
arrOfEl = ['jason', 'jason', 'jason', 'james', 'james', 'jason', 'james', 'johan', 'jonah', 'jason', 'james', 'james', 'james', 'john', 'johan', 'james', 'jason', 'jonah', 'jason', 'james', 'jack', 'jolly', 'jalop', 'johan', 'jonah', 'james', 'jeckyll', 'jack', 'johny', 'jockey', 'jockey', 'joke', 'joke', 'jonah', 'jason', 'james'];
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Underscore |
|
pending… |
Native |
|
pending… |
Loop |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments