escape-concat
JavaScript performance comparison
Preparation code
<script>
Benchmark.prototype.setup = function() {
function t1(v) {
return "<html>" + escape(v) + "</html>";
}
function t2(v) {
return "<html>" + v + "</html>";
}
var strs = [],
offset = 0;
for (var i = 0; i < 1e6; i++) {
strs.push("big-string #" + i);
}
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Escape-concat |
|
pending… |
Concat |
|
pending… |
Escape (html) |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments