Fuck aspxformat

JavaScript performance comparison

Revision 2 of this 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 str = _aspxFormatString("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.", "shit1", "shit2", "shit3");
pending…
push
var str = ["MooTools is a compact, modular", "test1", "Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, ", "test2", "flexible, and cross-browser code {2}with its elegant, well documented, and coherent API."].join("");
pending…
concat
var str = "MooTools is a compact, modular" +
 "test1" +
"Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful," +
"test2" +
"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