The other day I was working on some JavaScript code that needed to iterate over huge arrays. I was using jQuery's $.each function just because it was simple, but I had heard from a bunch of articles on the web that $.each was much slower than a normal for loop. That certainly made sense, and switching to a normal for loop sped up my code quite a bit in the sections that dealt with large arrays.
I'd also recently seen an article on Ajaxian about a new library, Underscore.js that claimed to include, among other nice Ruby-style functional building blocks, an each function that was powered by the JavaScript 1.5 Array.forEach when it was available (and degrading for IE). I wondered how much faster that was than jQuery's $.each, and that got me to thinking about all the different ways to iterate over an array in JavaScript, so I decided to test them out and compare them in different browsers.
This gets pretty long so the rest is after the jump.
JSONView 0.4 was just approved on addons.mozilla.org. This one is mostly a bugfix release from 0.3, but I couldn't let it go out without one new feature, so I finally added support for content negotation. This means that you can go to the new JSONView...
In the last few weeks I've become increasingly obsessed with the evil genius that is Swoopo.com. Swoopo is a penny-auction site - users buy bids for $0.60, and each bid placed on an item increases the price by $0.12. The cost of bids and the amount...
I've finally gotten around to doing some maintenance updates on three of my most-used bits of software (JSONView, XBList, and TopProcess), all in the last couple weeks. Now that they're all approved and live, I thought I'd summarize what's changed...
I've just uploaded a new version of XBList that fixes it after the new Xbox.com site changed everything around. Oh, the joys of writing a screen-scraping app! There's some good news though - the new Xbox.com design actually puts much more info on the...
Just a quick update on JSONView - I've submitted version 0.2 to addons.mozilla.org. This new version doesn't have a lot of changes, but it adds some new translations (Hungarian, Bulgarian, German, and some Turkish), and you can now open “.json” files...
Today I uploaded a new version of JSONView to addons.mozilla.org. I'm sticking with the wimpy version number for now, but I think JSONView has been proving itself out in the wild. One major bug was uncovered that caused JSON documents larger than 8KB...
I'm a big fan of JSON as a data exchange format. It's simple, lightweight, easy to produce and easy to consume. However, JSON hasn't quite caught up to XML in terms of tool support. For example, if you try to visit a URL that produces JSON (using the...
I just finished Fallout 3 last night. Yeah, that's one of the reasons I haven't released anything new in a while. One of my favorite parts of the game was the old music they used. I loved the BioShock soundtrack too. Now that I'm done with the game...
File this under small victories, I guess. A couple months ago my trusty old ThinkPad R51 decided to cook itself to death, so I went ahead and got a shiny new ThinkPad T500. It's quite an upgrade, but I missed one feature from my old machine. ThinkPads...