Quantcast

Thursday, September 04, 2008

Google Chrome

Google finally has come out with a browser of it's own, it's christened as Google Chrome. It's Google's open source browser project through which Google has stepped into the browser market. With so many browsers available in the market, you must be thinking what's so special about Google Chrome?

First of all, we should understand that most of the websites that we visit now a days are not just a collection of web pages, rather they are applications. Whatever we do now on the internet like watch and upload videos, chat, play online games, these things didn't exist when the first set of browsers were created. So Google thought about making something to cater to the needs of the modern day applications and a modern day user.

At Google they felt that browsers needs to be more stable, it needs to be more faster, it needs to be more secure along with being clean and efficient. During the initial phase of the project, the guys in Google mainly focused on one of the biggest problems of the modern day browsers. All of them are inherently single-threaded. Now what do we mean by that? It's very simple, say for example you are viewing a website which has a JavaScript coded into it. Once the browser starts to execute the script the control gets transferred from the browser to the script. So till the time the script completes functioning the browser cannot do anything else. So the developers write APIs which are asynchronous in nature. Which is why every now and then the browser hangs when a script stops running.

Initially Google was thinking about a multi-threaded browser but finally they decided upon a multi-process browser. In this architecture, each process has it's own copy of global data structures which is quite similar with the architecture of any modern OS. So in Chrome we have separate JavaScript threads. So if one of the tab is busy we would still be able to use the other tabs as well. And if there is a bug in the renderer, only one of the tabs crashes but the rest remains the same. Oh! and when one of the tabs crashes we get the "sad tab" which actually has a sad smiley on it. And although a multi-process design seems to be using a bit more memory yet over the time it will also mean a less memory bloat.

In a traditional browser, we only have one process and one address space that the web pages keep loading onto. When we have too many tabs open we need to close some to free up memory. When we open up a new tab we use the memory which was being used previously. But over the time due to fragmentation memory gets wasted. Which makes the browser slower and slower with time. But with Chrome when a tab is closed the whole process is terminated and all that memory gets reclaimed. So in case of a memory leak it would not affect much because once the tab is closed the memory is recovered. Now to take that one step further, while surfing from domain A to domain B the rendering engine can also be changed along with the data structure and process. So you can use Google Chrome's task manager to look up which tab or process is taking the most amount of memory and then end it if required. Even the plug-ins can be seen in the task manager as they appear as separate processes.

With the presence of a massive infrastructure for crawling web pages, Google tested Chrome-bots with millions of pages which would would otherwise have taken months or years maybe.

The open source rendering engine for Google Chrome is called Webkit. It is easily adaptable to embedded devices. Google have also build up a JavaScript virtual machine which helps in providing security and platform independence. With this Google have eliminated the core design flaw of current JavaScript's engines, bad garbage collection.

Overall Google has made it's browser robust yet simplistic in nature. I have downloaded the Google Chrome myself and am finding it very easy to use, it's fast and compact. But it's now to the developers to build plug-ins and applications to cater to the other needs of browsing, like download managers etc.


0 Comment:

Post a Comment

Blog comment guideline