Vector-vs-string
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
var compare_ind = 1+2<<5+3<<(5*2)
var compare_pos = [1, 2, 3]
var compare_str = '1|2|3'
};
Benchmark.prototype.teardown = function() {
if (result != true) alert('error!')
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Index |
|
pending… |
Pos |
|
pending… |
String |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments