BestEmptyArray
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var aArray = [2, 4, 5, 6, 7, 8, 9, 10, 11];
};
Benchmark.prototype.teardown = function() {
if (aArray.length !== 0) {
throw new Error();
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
equal empty array |
|
pending… |
length equals 0 |
|
pending… |
splice |
|
pending… |
filter |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Tomas Corral
- Revision 2: published by Tomas Corral
0 comments