Tuesday, February 14, 2006

There's only so much a client side script can do

I just got the Gmail Chat upgrade. It's really nice. It actually works really well considering that I'm logged into Google Talk at the same time. It understands that I've sent someone a message from a particular location, only directs their replies to that location, etc. It also logs chats in Gmail, which I like. I would prefer they be stored there instead of on my work harddisk, frankly.

However, this upgrade has made Gmail slower, again. I'm running in Firefox on a monster PC at work (dual 3.4 ghz xeon, 64-bit windows, 4G of ram). It's popping up windows all over the place that seem kind of pokey. The presence of the chat window itself just seems to be slightly slowing things down a little bit.

Meanwhile, I was looking at a news story on Marketwatch.com this morning, who have cleverly made it so stock quotes update live while you read the story. That's nice and clever, but again it's just making my webpage slower.

Softimage XSI, a 3D application, allows you to script in Python or JScript, thanks to exposing a COM interface. Even with the extra COM layer, I ran some tests that showed Python to be about 3x faster than JScript. And my test was mostly just making calls into the app, with a few inner loops to do some calculations.

So where's the cap on the amount of functionality that we can shove into Javascript and hope the web browser can handle? By all accounts, Javascript is slow. Writing a fully functional, interactive UI would just be too slow to be useful -- and this is the limit that Gmail seems to be approaching right about now.

What's the solution, JITted Javascript? What sick person would do that?

I think the latest speed hit on Gmail is another bullet point to back up my claim that Javascript is a language we're all going to end up tearing out of these websites sooner or later. In the future, we will still see data-driven UIs using something like XAML, but backed up by code that can actually be reasonably developed and JITted. C# and Java are your two main possibilities, one's got Microsoft on its side of course.

1 comment:

b said...

The memory issue is only in firefox. Firefox already had an issue with just leaving a gmail window open. The memory gets out of control. Firefox definitely has memory leaks all over the place. It also doesn't help that the browser uses a single process shared by every window and every tab. I've also noticed sites with DHTML slow down noticeable when viewed within firefox.

On IE, I can run gmail for the entire day while chatting and I have no issues. Plus if gmail *does* crash IE - which almost never happens, it won't crash every browser window I have open.