String Splitting

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var selector1 = "Element#addEventListener";
    var selector2 = "Object#defineProperty";
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Split
selector1.split("#");
selector2.split("#");
pending…
Substring
var i = selector1.indexOf("#");
selector1.substring(0, i);
selector1.substr(i + 1);

var j = selector2.indexOf("#");
selector2.substring(0, j);
selector2.substr(j + 1);
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