Fuck aspxformat

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    function _aspxFormatString(str) {
      for (var i = 0; i < arguments.length - 1; i++)
        str = str.replace(new RegExp('\\{' + i + '\\}', "g"), arguments[i + 1]);
      return str;
    }
};
</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
with aspxformat
var test = "MooTools is a compact, modular{0}, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, {1}flexible, and cross-browser code {2}with its elegant, well documented, and coherent API.";
var str = _aspxFormatString(test, "shit1", "shit2", "shit3");
pending…
push
var test = [];
test.push("MooTools is a compact, modular");
test.push("test1");
test.push("Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, ");
test.push("test2");
test.push("flexible, and cross-browser code {2}with its elegant, well documented, and coherent API.");
var str = test.join("");
pending…
concat
var str = "MooTools is a compact, modular"
str += "test1";
str += "Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful,";
str += "test2";
str += "flexible, and cross-browser code {2}with its elegant, well documented, and coherent API.";
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:

0 comments

Add a comment