Wednesday, September 10, 2008

Google Chrome

Google Chrome

It is a not a new buzz word. It is going next Gen web browser. Just due to the amount of features what it offers beneath the browser. Quite a lot of architecture changes to a browser

Tabbing

Opening a Tab in a window was a craze when it first came out in FireFox or Mozilla, IE also copied it soon. But there were host of problems with the way Tabs were architectured to run internally in the browser. It was designed as One Process per Window, so if you open multiple tabs within the same window it is single process and multiple threads and it all shared the same address space in windows. So a programmer who knows hack into this can read the data handled in the next tab, for example you have opened a credit card statement in one tab and some website which runs the Malware in the next tab, the Malware can read the credit card statement since it is under the same process. If 1 of the 10 tabs that were opened in a window crashes then the whole window will crash. All these problems have been alleviated in Google Chrome.
1 Tab -- > 1 Process  1 address space. It is crash proof against other bad tabs.

JavaScript

Performance
JavaScript is the most important thing in web today. There are so much complex things done with JavaScript today, the performance of JavaScript affects the web applications.
Being a web developer myself, I know the pain of trying to improve the performance of slow running web application, most of the times the culprit is the slow running or slow loading Java Script. Browsers are inherently single threaded, Browsers have to handle the control the JavaScript when it starts executing, the browser cannot do anything till the JavaScript finishes execution and handles the control back to the Browser. If there are 10 tabs opened in a window and 1 tab starts executing the complex JavaScript, then the all the 10 tabs will stop responding till the execution of JavaScript is complete. With 1 Tab -- > 1 Process  1 address space this problem is addressed.

Compatibility

When you write a web application with lot of JavaScript in it then the web application has to be tested for compatibility since the JavaScript implementation and support is different in different browsers. Again being the web developer, seeing something not working properly in one browser to the other can be nasty. I wish JavaScript had a Virtual Machine which takes care of the internal implementation rather than the developer worrying about those. My prayer for a VM in JavaScript has been partially answered, with the introduction of JavaScript Virtual Machine V8. I wish that the JavaScript VM becomes a standard and other browsers also adapt this.

Memory Handling

The main problem with the JavaScript is Bad Garbage Collection, I would say worst Garbage collection. Current Browsers with the existing JavaScript uses Conservative Garbage Collection. It is like you have a Rack full of bundled clothes and searching for a small Handkerchief in the mess, you wouldn’t know where the Handkerchief would be so it is going to take more time to find it. If you exactly know where the Handkerchiefs are stored it would make it faster to search and find those, that is what the JavaScript VM V8 does. It also does an Incremental Garbage collection which can result in the applications being more interactive like a smoother drag and drop in the netflix applications.


Security

As I said earlier in the Tabbing section of the blog 1 Tab  1 Processes  1 Address Space. This architecture change has enabled the Sandboxing of the Tabs, means they can use the processor for computing but they cannot use it for read files from the machine or write files in the machine. Plugins have always been a big headache for the security of the browser’s (client) machines that run those. Plugins can access anything in the browsers machine and read or write things. For example if we install a Adobe Plugin in the browser, that does not fall under the standard security, they generally run at a higher level and generally works with the renderer( the part of the browser) which graphically displays the web page to the user. Renderer and Plugins run in the same address space. But in Google Chrome the plugins have been isolated and have been kept in a separate address space or sandboxed in a separate address space, so the security threat is minimized to a great extent. Another major problem with internet security is phishing attacks, it is like for example there is a bank site called www.icici.com and there is a hacker who opens a www.icicibank.com , how would you know what is the original site and where to enter the password, Google Chrome claims to warn the users against the phishing attacks and keeps updating the list of phishing websites. This sounds interesting but not sure on how well it would work.


End user should not worry about what happens under the hood of the browser and shouldn’t find a difference between the application written as a thick client (stand alone application) or thin client (browser), usability of the application shouldn’t get affected, and there are limitations with writing applications of that kind with the existing technologies and with the existing browsers. I hope Google chrome can address that problem too. Definitely a good start but way to go.

4 comments:

Kamini Santhanagopalan said...

WOW is the word malai, I better delete my post :D :P Didn't know these architectural level intricacies involved...How many times have I told you to start a blog for technical stuff? Dude, whats stopping you from doing it :)

Shankar said...

nice write up da... i dint get the full tech details when i read the review in msn.. but this clears a lot!!

Malaikannan Sankarasubbu said...

I guess google will have more plans for this browser, definitely they will improve the UI and customize it for better performance of google applications.

Unknown said...

I have downloaded google chrome!!! I will let you if it is boon or a bane ;))