We Get Requests

January 17, 2008 – 11:54 am

As I mentioned a few days ago, we’ve started converting DrProject’s interface to Dojo. We like the look and feel a lot, but were finding it very slow (several seconds per page, rather than half a second). Alex Russell was kind enough to explain what we were doing wrong, and to give me permission to post his explanation on the DrProject wiki.

  1. 2 Responses to “We Get Requests”

  2. I’d consider using JQuery. It’s very light-weight and the object selection query engine uses the browser’s own xpath engine so it makes it super fast. It only weighs 15kb compressed, so loading times are fast, too. It also has many plugins if you need pre-built functionality like sortable grids, etc.

    I’ll admit I haven’t used Dojo, but from using MochiKit (still holds a fond place in my heart), JQuery, YUI, and reading about various other javascript libraries, I would definitely pick JQuery for a non-internal webapp.

    By Andrey on Jan 17, 2008

  3. Hey Andrey:

    You’re reading too much of the jquery marketing material ;-)

    Dojo uses the xpath engine but jquery doesn’t, as a result we usually beat them in speed tests. The analogous Dojo file (dojo.js) is 23K on the wire, and in addition to being tiny and super-fast at querying, it’s also edge-cached for you on AOL’s CDN (http://build.dojotoolkit.org), so you don’t have to worry about correctly configuring your web server for that stuff. Users also are much more likely to already have the toolkit cached if it’s coming from the CDN.

    Dojo’s 23K size includes tons of stuff you’re really going to need: json encoding and decoding, a great event system that handles lots of cases that jquery doesn’t, and of course the package system which gives you access to all the other dojo modules without digging through a bunch of “plugins” and makes the super-simple to use…even from the CDN.

    What’s great about the build system is that once you’re using the package system, not only do you not need to worry about which order you include your files in, you can use the instructions that are linked to in the DrProject wiki to make your app go faster *without code changes to the app*.

    If you start going down the jquery route, you’ll soon end up in the same place that DrProject did but without the benefit of integrated tools to help you go further when you hit that wall.

    You said you haven’t really played with Dojo, and I’d like to personally encourage you to do so. Dojo has solutions to lots of problems that the JQuery community is only now starting to think about, and supports the same kinds of progressive enhancement and easy query-based semantics that you already know and like.

    Regards

    By Alex Russell on Jan 18, 2008

Post a Comment