slowloop

JavaScript performance comparison

Test case created by Josh

Preparation code

 

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
parsing original
var parseBuylist = function(obj) {

  // Set up vars for product loop
  var len = obj.length;
  var i = 0;

  // Loop thru buylist products returned
  for (i; i < len; i += 1) {

    // Reference to one product
    var product = obj[i];

    // Assign product info to vars
    var name = product['Product Name'];
    var category = product['Category'];
    var price = product['Buy Price'];
    var qty = product['Opt Qty'];

    var link = formatLink(product['URL']);
    var credit = creditPrice(price);

    // Build the markup for each product row
    var markup = '<tr class="item" data-category="' + category + '">';

    // Markup for product name + link
    markup += '<td class="name"><a href="' + link + '" title="' + name + '">' + name + '</a></td>';

    // Marup for category cell
    markup += '<td class="category">' + category + '</td>';

    // Markup for product cash
    markup += '<td class="cash">$' + price + ' USD</td>';

    // Markup for product credit
    markup += '<td class="credit">$' + credit + ' USD</td>';

    // Markup for product qty
    markup += '<td class="qty">' + qty + '</td>';

    // Close table row
    markup += '</tr>';

    jQuery('#buylist-items').append(markup);

  }

};
 
pending…
parse original2
var ghjk;
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