string split join
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
// We need the fastest way to to remove the last part of the string,
// after the last "."
var string = 'a.b.c.d'
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
split, slice, join |
|
pending… |
split, slice, join |
|
pending… |
slice, lastIndexOf |
|
pending… |
substring, lastIndexOf |
|
pending… |
substr, lastIndexOf |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments