jQuery and Prototype Benchmarks

Posted on April 15th, 2008, by Cristian in Development, Javascript, jQuery

Piotr Solnica did a couple of posts on jQuery and Prototype benchmarks back in the day, and John-David Dalton just found them.

In part one, he runs tests such as:

$('td.first').addClass('marked'); // jQuery

$$('td.first').each(function(cell){
  cell.addClassName('marked');
});

// or 

$$('td.first').invoke('addClassName', 'marked');

and concludes:

Executed tests show that Prototype seems to be faster then jQuery, with the exception of the new insertion method, which performance should be improved. Although I like jQuery syntax more then Prototype, the performance is way more important then saving few lines of code. Of course tests that I made don’t show how these libraries act in a real application, which is my task for the next part(s) of this article. Despite the results I must admit that I’m very excited about jQuery, my general impression is that this library is more mature then Prototype.

In part two, Piotr uses a custom JavaScript-based testing environment instead of running tests using Firebug profiler. This allows the test suite to run in many browsers, and this time concludes:

Prototype was at least 2 times faster then jQuery in 15 cases, and jQuery was faster then Prototype in 8 cases. What library should I choose? In my case I will stick with Prototype, because it offers the same functionality as jQuery does + more and it’s faster. jQuery is probably better for projects where there’s a need for some fancy UI effects and that’s it, but it’s just an assumption, correct me if I’m wrong…

Manage JavaScript Dependencies

Posted on April 15th, 2008, by Cristian in Development, Javascript

Jon Davis created Using.js, a simple library to manage dependencies with the goals of:

  • Separate script dependencies from HTML markup (let the script framework figure out the dependencies it needs, not the designer)
  • Make script referencing as simple and easy as possible (no need to manage the HTML files)
  • Lazy load the scripts and not load them until and unless they are actually needed at runtime.

To use the script you simply:

// potential scripts are pre-registered first
using.register("jquery", "/scripts/jquery-1.2.3.js");

// later, when actually needed
using("jquery"); // loads jQuery and de-registers jQuery from using

$("a").css("text-decoration", "none");

// or asynchronously

using("jquery", function() {
$("a").css("text-decoration", "none");
});

As we see more and more tactics for getting performance by doing tricks with when scripts are loaded, I expect to see more of libraries like this. The key is working out exactly what script needs to be loaded right away, after the DOM is around, and what can wait for later. How do you want to load the script? Dynamic script element? Via iframe? XHR + eval? They all have pros and cons.

The Highly Extensible CSS Interface Series

Posted on April 6th, 2008, by Cristian in Development, Tutorials, Usability & SEO, Xhtml & CSS

Cameron Moll introduced “The Highly Extensible CSS Interface”, a four-part series of how-to’s and savvy conversation. The phrase “highly extensible” is in reference to designing and coding interfaces that are flexible enough to adapt in ways the designer or developer may not foresee when handing off coded templates, while still retaining the overall aesthetic integrity of the layout.

Read the rest of this entry »

Upgrading to Wordpress 2.5

Posted on April 2nd, 2008, by Cristian in Blogging, Development, Xhtml & CSS

After I made a WordPress 2.5 Interface Review I decided to upgrade my blog and to test “on live” the new improvements & features. The upgrade process went fine, I have no problems. I must admit that the new WP 2.5 is great, a lot of improvements but I still don’t like their color scheme.

If you don’t know how to upgrade you blog read the Upgrading instructions or contact me and I will help you.

But!!!! Writing the previous post I found one big problem or bug. I do not know exactly in my case if this was a bug. I could not upload images to the post, and I wasn’t very happy about this. After a long research I found a list of solutions to the problem, Things to try. In my case the #7 worked, it was the only one that I tried because the other I excluded:

Read the rest of this entry »

My new books

Posted on April 2nd, 2008, by Cristian in Blogging

Hi! After a week of vacations I’m finally back to my blog and work :), and I want to post about some of my new acquisitions after a week in London.

There are 4 books written by Julius Wiedemann: Web Design Studios 2, E-Commerce, Flash Sites, Best Portfolios

A great catalogs of the best web studios in the world. Very usefull as a benchmarking guide in webdesign area. If you’re interested in web 2.0 you will enjoy these books because they are a great resource packed with lots of web design ideas and executions.

Read the rest of this entry »

Advertise / Sponsors

How to Be a Rockstar Freelancer
Comments RSS Feed

Recent Comments

  • Julian Gruber: Thank you! Following those advices really can make a big difference for the success of a webapp.
  • Tom Humes: Nice Site layout for your blog. I am looking forward to reading more from you. Tom Humes
  • admin: Yes, it does the same. Basic I just get the object $(”#nicemenu span.head_menu”) once, and applied the...
  • André Beaudry: Hi, I would like to know why : $(”#nicemenu span.head_menu”).mouseov er(function(){...
  • admin: Try to change the z-index to the menu container in my example div #nicemenu. The first one should have for ex....