Nitobi
About Nitobi
Services
Products
Home -> Blogs -> Dave Johnson

Dave Johnson

JavaScript Benchmarking - Part 3.1

September 15th, 2005

With the open source release of Google�s GOOG-AJAXSLT JavaScript library I thought that it would be interesting to look at the performance in various browsers. It is of particular importance when building responsive AJaX applications on Opera, which does not support XSL-T at this time. Of course there is no reason for using this library in Firefox or Internet Explorer since they both have support for doing XSL-T transformations.

I made a simple XSL-T document that used various functions such as

, ,
etc and had it generates some HTML output. I measured the time taken to perform the transform operation with varying numbers of rows in the output HTML. The result is short and sweet and can be seen below.

Luckily, it performs best on Opera which is the browser that does not natively support XSL-T. That being said, in the region of interest here the built-in transformation engines in IE, NS and FF can do the work in the 1ms range.

The question is can there be any optimization done to make the code run faster? Looking through the code I did notice that there are many loops that check values such as

node.children.length
on every iteration and similarly access
node.children[i]
. Also, there are many functions that use += to concatenate strings and we all know that building an array and calling
stringArray.join('')
can be very fast when dealing with large strings. Depending on the size of the transformation there could be performance gains there.

Tests were done on a 2GHz Celeron running Win2K server using IE6, NS8, FF1 and OP8.

Del.icio.us

This entry was posted on Thursday, September 15th, 2005 at 11:26 am and is filed under Web2.0, AJAX, XML, XSLT. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “JavaScript Benchmarking - Part 3.1”

  1. Dave Johnson » Blog Archive » JSON Benchmarking: Beating a Dead Horse Says:

    […] References [1] The AJAX Response: XML, HTML or JSON - Peter-Paul Koch, Dec 17, 2005 [2] Objectifying XML - E4X for Mozilla 1.1 - Kurt Cagle, June 13, 2005 [3] JavaScript Benchmarking - Part 3.1 - Dave Johnson, Sept 15, 2005 […]

Leave a Reply


Search Posts

Pages

Archives

Categories

All contents are (c) Copyright 2006, Nitobi Software Inc. All rights Reserved
Dave Johnson Entries (RSS) and Comments (RSS).