Tuesday
11
Oct 2005

The tale of two worlds - JavaScript OO performance in Firefox and IE

(8:58 am) Tags: [Software, Rants, Projects, FeedLounge]

After looking at the source for Mochikit, Dojo, Prototype and others, I decided that FeedLounge could use a bit more object-orientation in the client side code.

I created a simple object structure, and wrote a few little test scripts that I ran in the browser. Since I subscribe to 1500+ feeds in FeedLounge, the feed loading/processing on the client side is getting quite slow, so I wanted to make sure that this refactoring was going to help and not hinder client-side performance.

While the test results show what I have built will help performance quite a bit (no more looping over DOM nodes, looking for the right one), the results were a bit surprising…

Given 2 objects, feed and tag, where a tag can contain feeds, I wrote a simple loop to create n feeds, and set an unread count on the feed, then add that feed to a single tag (the worst case in FeedLounge). I wanted to make sure that this solution would scale for the power user, so I started the test at n=5000.

At 5000 feeds to a tag, Firefox was running the code in less than 1 second, which seemed acceptable, so I bumped up n=50000. Firefox choked saying “Out of memory”, so I dropped it in half to n=25000.

The loop at 25000 took 3 seconds of full CPU to run, and the count items return was quite quick. On to test IE, since we support more than just one browser…

In testing IE, I was shocked to find it taking 3 minutes at 100% CPU to run the loop at n=25000. It did eventually finish, but while I can justify 3 seconds on initial home page load to my users, I don’t think they will stand for 3 minutes! I also noticed that memory consumption in IE was over 3 times as much as Firefox. For n=25000, the delta in Firefox had been 50MB. That seems like a lot, but I also didn’t see many people subscribing to 25000 feeds. In IE, the memory usage was 160MB!

Does anyone have any ideas in how to optimize JavaScript for IE? I am doing some extremely simple things here, nothing rocket science at all.

I am not too terribly worried, as the patch for power users of FeedLounge is to switch to Firefox :)

Popularity: 35%

Comments: (17)

Using Skype call forwarding

(8:42 am) Tags: [General]

Having used Skype very little in the past, mostly because I have a lot of cell phone minutes, I had fogotten it was there, until a few folks at Apache set up a Skype conference call to talk about some infrastructure related items.

Since I do not own a headset for the computer, and I lost the charger to the abysmal Bluetooth headset that I have, I was looking for other options. I found that Skype has the ability to forward to your cell phone number when you are not online. After trying to find it in the options, I Googled a bit more and found out it only worked on the Windows client.

Although that sucks, I do still have a Windows machine “just lying around”, and I installed the latest Skype client for Windows. It seems that the call forwarding option works when you make yourself look Offline, but the Windows client is the one doing the work.

I tested it out with Leo, and it seemed to work just fine, but I have to ask myself, if this uses SkypeOut minutes (I am paying for it), shouldn’t it also work when I am not even net-connected? That would seem like the most appropriate time to use such a feature, no?

Popularity: 23%

Comments: (1)