DOMBars

JavaScript performance comparison

Revision 5 of this test case created

Preparation code

<div id="fixture"></div>

<script src="https://rawgithub.com/blakeembrey/dombars/master/dist/dombars.min.js"></script>

<script>
var template = '<div class="test"><p data-attr="random">text and stuff <span>inline element</span></p><br><p class="style">some styles</p></div>';
</script>
<script>
Benchmark.prototype.setup = function() {
    var fixture      = document.getElementById('fixture');
    var domTemplate  = DOMBars.compile(template);
    var htmlTemplate = function () { return template; };
};

Benchmark.prototype.teardown = function() {
    var fixture      = document.getElementById('fixture');
    fixture.innerHTML = '';
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
String
var fixture      = document.getElementById('fixture');
fixture.innerHTML = htmlTemplate();
pending…
DOMBars
var fixture      = document.getElementById('fixture');
fixture.appendChild(domTemplate());
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