September 4, 2008

Most of you would have read about the new and fast browser from Google called Chrome. I have always been amazed at how Google gives its own twist to a well established application paradigm. When they announced Gmail, I wondered how I was using an email application without conversation mode so far and immediately fell in love with Gmail. This time, it is Chrome. Geeks who tested it with Javascript benchmarks are stunned by the results from benchmarks. Everyday internet users who tried Chrome are not so impressed because it's not visibly faster than IE or Firefox for most websites. And that is because the Web is not yet ready for Chrome! Let me explain why.

It is an understatement to call Chrome as a browser. It is a mini operating system for running Web applications. So far, most of the Web applications have been running on the server side and used the browser only for display. Recently, there has been a push towards Rich Internet Applications (RIA) that use your browser's advanced functionalities such as Flash, Javascript etc to deliver desktop application-like complex feature set. Zoho and Google docs are examples of popular Office applications that run in your browser. This trend has just started and is growing. Think of a photo/image editing application as complex as Adobe Photoshop but runs in a browser and allows you and your friend (living in a different state/country) to edit a photo simultaneously across the Web. Think of a Movie editing application like Windows Movie maker that runs online completely. Chrome has been designed with such complex future applications in mind and that's why we don't see its impact right now.

Let me just touch upon the features of Chrome that make it suitable for such complex applications.

Application Isolation

Any complex application will have atleast a few bugs. Imagine that you are running a Photoshop-like application in one tab of IE/Firefox and a Powerpoint-like application in another tab. If the photo application crashes because of a bug, IE/Firefox itself will die and you will lose your (potentially unsaved) work in the presentation application. This is unlike a real OS environment where PhotoShop crashing won't affect PowerPoint application. Chrome provides such isolation by restricting the failure to just one tab and all other tabs will stay alive. There are very few websites that use Javascript heavily now. So, the impact of this will only be seen in future.

Memory Management

Any good Operating System will try to avoid memory fragmentation and reclaim unused memory effectively. Chrome does this by creating a different process for each tab and using a thorough garbage collection mechanism. Chrome comic book explains this clearly if you are interested. Yes, it will take up more operating memory than Firefox due to multiple processes but then Chrome is not just a browser. It's a platform for complex applications that will require lot of memory themselves.

V8 Javascript Compiler

As you know, Javascript is the language for creating client-side Internet applications. Normal websites will only have a few lines of Javascript. But truely complex applications could have thousands of lines of js code. So far, Javascript engines have always been interpreting the javascript code whereas V8 will compile it directly to the target machine code. Anybody who has taken a basic computer course will know that interpretation is much slower than compilation. Java, when it was originally introduced, was an interpreted language and it was dead slow. Later, they implemented Just-in-time (JIT) compiler and there was dramatic improvement (I have experienced the difference myself when I was working on a JVM). Now, Chrome has given Javascript the status of an advanced programming language! This will encourage developers to build Internet applications that will run much faster. Their Javascript application will run as fast as a C++ or C# application and it will also be able to collaborate effectively across the Web.

So, the next time you see somebody ignoring Chrome as just another browser, tell them it's not. Chrome is getting ready for the future of Internet. It's just that the Web is not ready for Chrome yet.