template engine comp

JavaScript performance comparison

Test case created

Preparation code

<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
Benchmark.prototype.setup = function() {
    <script type="text/html" id='usageList'>
    <table cellspacing='0' cellpadding='0' border='1' >
            <% _.each(items,function(item,key,list){ %>
            <% var f = item.name; %><!-- create more variables -->
                    <!-- use variables -->
                    <td><%= key %></td>
                    <td class="<%= f %>"><%= item.name %></td>
            <% }); %>
    <!-- Create your target -->
    <div id="target"></div>
    <script type="text/javascript">
        var items = [

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
var template = $("#usageList").html();
underscore with
var template = $("#usageList").html();

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers


Comment form temporarily disabled.

Add a comment