Browser war centers on once-obscure JavaScript
After inconspicuously lurking within Web sites' code for more than a decade, JavaScript has emerged to become a key battleground in a second era of Web browser wars.
JavaScript, which lets developers create everything from basic Web site menus to online spreadsheet applications, was born in the mid-1990s when Microsoft's Internet Explorer challenged the incumbent browser, Netscape's Navigator. IE won that war, but now it faces its own challenge from the heir to the Navigator throne, Mozilla's Firefox, along with upstarts including Google's Chrome, Apple's Safari, and Opera.
All the challengers tout JavaScript performance as a major part of their competitive attack--even to the point of naming their JavaScript engines built into their browsers: Chrome's V8, Firefox's TraceMonkey, Opera's Futhark and upcoming Carakan, and Safari's newly branded Nitro, which is Apple's version of WebKit's Squirrelfish.
Microsoft's tests of page-loading speeds gave it the edge over Chrome and Firefox. But page-loading speed isn't everything
(Credit: Microsoft)Though IE lags all these rivals in JavaScript performance, Microsoft does care about performance overall and JavaScript performance specifically. Even as Microsoft launched a brand-new browser version, Internet Explorer 8, on Thursday, however, it's also clear the company has a big difference of opinion about the matter.
"We're going to keep making the script engines faster (but) right now it's not clear how many people are gated by script performance," said IE general manager Dean Hachamovitch in an interview. "JavaScript comprises a small portion of how fast a Web page will render. It is a piece, but by no means the holy grail."
Because it's easy to measure, JavaScript performance has "become shorthand for browser performance," Hachamovitch added. Microsoft has begun touting its new test of page-loading speeds in which IE 8 fared better overall than Firefox 3.0.5 and Chrome 1.0. A supporting slow-motion video (click "Case Study Videos, then Performance Testing) shows page-loading speeds down to the hundredth of a second.
Likely not coincidentally, though, Google offered its own propaganda the day before the IE 8 launch. Google launched its Chrome Experiments site to tout what can be done with high-performance JavaScript and to promote its browser. While Chrome generally runs sites' applications with aplomb, that isn't the case for IE.
Browsing vs. running applications
Here's what the difference between the companies boils down to: Microsoft is focusing on today's Web, and the rivals are focusing on tomorrow's.
The Internet is growing from a Web made of static pages to be read with links to be clicked into a Web that also includes applications that perform computational tasks and that people interact with. In other words, browsers now have to process data as well as load pages. Microsoft's dominant share--67 percent according to Net Applications' figures--reflects the more mainstream world, and the challengers are aiming for where they think the mainstream will be going.
"The faster we make JavaScript, the more interesting and interactive the Web becomes," said Mike Beltzner, Mozilla's director of Firefox.
Google agrees. "We saw a lot of Web developers lamenting the fact that they couldn't do what they wanted to do because JavaScript was a limiting factor," said Darin Fisher, a Chrome engineer at Google. It's certainly not the only bottleneck, but Google concluded that "by far the biggest performance opportunity we saw was to improve JavaScript."
Google has a direct interest in faster JavaScript. It's among the biggest advocates of cloud computing, in which Internet-based applications and services replace those running natively on a personal computer.
On a recent SunSpider test of JavaScript performance, IE comes in last.
(Credit: Stephen Shankland/CNET)But Google Docs, Google Calendar, and Gmail aren't rarities. Yahoo, Facebook, and countless other sites make extensive use of JavaScript, and Microsoft itself is working to produce online versions of its Office suite.
AdventNet's Zoho division, which also offers Web-based tools for word processing, spreadsheets, and other tasks, is another company eager for faster JavaScript. Currently the company has to show a separate site with reduced abilities to people who use IE 6 with the site, said Zoho Chief Executive Sridhar Vembu.
"We're excited because this represents a fundamental breakthrough in JavaScript performance and capability for applications like ours," Vembu said of the new generation of browsers. "Within a year I think we'll see such browsers dominating the landscape."
He's also optimistic that Microsoft will close the JavaScript gap with its rivals. "I believe Microsoft will catch up," he said.
To emphasize only JavaScript for Web applications is to oversimplify the situation. (And of course there are any number of other aspects of browser quality, including security, plug-in availability, operating system support, user interface responsiveness, Web site support.) Web applications also benefit from new technology arriving Web standards including HTML (Hypertext Markup Language) 5 and CSS (Cascading Style Sheets) 3. But JavaScript provides the programming language to join all those elements into a Web site that does something, not just shows something.
"All that is mediated by JavaScript. It's really the control structure of the Web," said Mozilla's Beltzner said.
A horse race
JavaScript didn't just catch on yesterday. Its popularity has been gradually building as programmers discovered how to use it to reproduce some of the interactivity of PC-based software in Web-based applications. For example, in Yahoo Mail, people can click on a message and drag it to a folder. Collectively, this higher-end JavaScript technology is called Ajax.
Microsoft's Internet Explorer remained the dominant browser in February 2009 but challengers have secured about a third of the market.
(Credit: Net Applications)"A couple years ago, people started embracing new development models that were even more JavaScript-heavy than before," Beltzner said. "We were getting to a point where Web developers wanted to do more than the browsers could handle."
In 2008, the JavaScript engines started hogging the spotlight in browser advancement circles. In June came Squirrelfish from WebKit, then Squirrelfish Extreme in September. Firefox announced TraceMonkey in August. Google touted V8 with its release of Chrome in September. Opera in February announced its aspiration to beat them all with Carakan, and later that month Apple touted the JavaScript speed of its new Safari 4 beta version.
"It was WebKit I think that really ignited the competition," Beltzner said. "Having somebody else play along (gave us) a way of us questioning our own assumptions about whether we have done the best we can do." And Chrome is "certainly keeping the pressure on."
Microsoft defends its priorities. "We're certainly aware of what the other browsers are doing," said IE senior director Amy Barzdukas. "Browser makers need to be sensitive not just to the cutting edge but to people who use the Web."
JavaScript vs. Flash and Silverlight
Microsoft also has another answer for those who want to build elaborate Web applications: its Silverlight software, version 3 of which the company detailed Wednesday. Silverlight competes most directly with Adobe Systems' Flash, the dominant browser plug-in used to provide applications with a lot of pizzazz.
Darin Fisher of Google's Chrome project.
(Credit: Stephen Shankland/CNET)The current trajectory of JavaScript means that it's encroaching more on the turf of Silverlight, which uses Microsoft's C# programming language, and Flash, which uses a JavaScript relative called ActionScript.
"JavaScript in Chrome almost reaches the speed of Flash," said programmer Mr. Doob, who wrote Chrome Experiments called Ball Pool and Google Gravity, in a blog post about them this week.
In an interview, Mr. Doob--a Flash programmer who learned JavaScript just for the Chrome Experiments and declined to give his real name--said JavaScript is about three quarters Flash's speed. There are weaknesses, though. For one thing, he found JavaScript developer tools to be primitive. For another, JavaScript varies from one browser to the next.
"The main benefit of ActionScript is that it will look exactly the same in any browser and in any version of the browser, even on IE6! With JavaScript it depends on which features the browser supports so you would spend more time making sure the project looks good in all the browsers than actually developing the project," he said. To make his Chrome experiments work on other browsers, "I'll have to introduce some hacks which will slow down performance and will dramatically affect the user experience."
Typically, though, as programming technologies mature, they settle into standards and get more refined tools. For now, performance is the top priority--at least until JavaScript gets fast enough that other problems move to the fore.
"All it took was a little competition to get other companies focusing on this problem," Fisher said. At some point, "Suddenly this problem won't be a problem anymore and we can move on to the next issue."
Stephen Shankland writes about a wide range of technology and products, but has a particular focus on browsers and digital photography. He joined CNET News in 1998 and since then also has covered Google, Yahoo, servers, supercomputing, Linux and open-source software, and science. E-mail Stephen, or follow him on Twitter at http://www.twitter.com/stshank. 




As noted in the article, it's going to be a long time before JS can catch the speed and smooth performance of Flash and SilverLight. Even it matches the speed, browser compatibility is going to be a big issue for the coder.
I appreciate Microsoft's decision not to give high priority on JavaScript performance now.
Whatever the client engine be (JS,Flash or SilverLight), ultimately, it's the viewer's computer CPU speed and RAM that decides how fast it runs.
Maybe, if there's a technology that would generate byte codes for Javascript before it's sent to the browser... But that's nearly impossible because Javascript's real strength is that it's interpreted and not compiled: code is able to generate more code on the fly.
Or, maybe FF, Chrome and others can introduce new "standard" and more sophisticated UI components (similar to what Silverlight of Flash have) in the browser that Javascript can take advantage of... but that doesn't improve Javascript performance... but just improves overall performance of the system.
I wouldn't fault Chrome and FF in trying to set javascript performance as the gold standard in overall performance, though... I think they are attempting to put a spec "sticker" on their product, similar to what's done to sell PCs (2GH, 4GB) or digital cameras (10 megapixels)... making "buying" decisions easier... if they're successful in doing this, they will earn more market share very quickly.
I agree with the author of this article, Stephen Shankland, that Chrome and FF are gearing their weapons towards the war of the future... The thing with that strategy is Javascript needs to be at the center of that future. If Silverlight or Flash wins, then this is all for nothing.
I can't image the transition from source-code to native/machine code?
I'm truly, truly amazed at how great JavaScript is as a language, but I just can't see it being compared to C++, C# or Java in terms of performance. But we said the same thing with Java before but less see.
I just can't see how you can compile things inside the eval()... since it won't be known until at runtime. Also, all variables are primitive objects so it's actual type and structure most of the time can only be determined at runtime -- not the case at all with Java or C#. Late binding which is also used by compiled languages (though not to the extent that Javascript has taken it) are very powerful... but it can also slow the process down.
By the way, I appreciate reading this well thought-out article. It is very refreshing since many of the articles that come nowadays in CNET are full of personal rants and most show very very obviously bias towards or against specific technologies or Vendor.
I love reading articles in CNET but now, I'm starting to find more interesting articles in eWeek for example that talk more about technology and not personal opinions that has nothing to do with technology. I hope CNET will find a way to maybe have a section on reporting and another on editorial (it can be on the same page, like, here's what's happening... now here's what I think...).
For example, in eWeek there was a full article regarding Microsoft promoting development of Silverlight (hence .Net) code in Eclipse on the Mac!
I learned about it through my colleagues in the office. I was so embarrassed to admit that I only read CNET. (Java and Eclipse is my bread-and-butter, but I'm also a .Net developer, so I really, really needed that story.)
CNET is increasingly becoming like the tabloid of Tech News. And that's sad...
Javascript is a big part of how pages are viewed today, and most javascript functions ARE the same from framwork to frameowrk, to touch on a point by alan_06. I've yet to see how Javascript varies from browser to browser in the functions that they support and don't support.
CPU speed and RAM matters for Flash plugin for sure. For example, bitmap level image processing like converting image to B&W on the fly.
Furthermore, JavaScript and Flash shouldn't be compared as if they were competing techniques. JavaScript's main use (in a browser environment) is DOM manipulation. This is something Flash wasn't built for. JavaScript, like Flash, can also do vector operations but once again, Microsoft prevents this use from becoming mainstream by not (natively) supporting the canvas element.
I would love to see Project Tamarin evolve into a Flash player that installs Screaming Monkey as the default JavaScript engine in IE and emulate the canvas element through the Flash player. Another dream of mine is that Microsoft would give the guys from Opera more money than the will ever need and make Opera the new Internet Explorer. Yeah, I know.... keep dreaming.....
The ability to run Javascript code fast is crucial in order for the browser to become a sophisticated application delivery platform.
These are some of the reasons Javascript is one of the most important aspects of a browser.
Even if you understand prototype behavior perfectly and fundamentally (which I still see majority of coders not to), code re usability and extensibility is not close to the same level as OO languages. It is a very concise and dynamic language, and actually really pleasant to use if understanding properly, but it's nowhere as scalable as C# or Java.
That is exactly the reason why JavaScript 2 will have proper class syntax and proper OO behavior.
I mean, can you imagine building OSX or Windows or Linux or even Firefox itself in javascript? ;-)...
C++, C, C# and Java is so much better than jscript
jscript is a scripting language
you can do much more things with C++ than you can do with js since C++ is a "real" programming language and js is not
The web isn't up to it and the cloud computing vendors will be doing everything legal and shady to indemify themselves at the same time they are selling the services.
Go back to traditional HTML, please. And bite me if you have a differing opinion.
Though I hope that Flash and Silverlight continue to be the ad-ware of choice.
Easy enough to never install those.
I actually use Java in other apps and hate the thought that it's turning into ad-ware
You really didn't try them much did you. That's about as superficial as it gets.
Did you try any real tests... http://www.acidtests.org/
Did you look at the Firefox plugins, even someone who isn't a web developer can appreciate adblocker.
Try acid3 on even IE8 it's score is well what do you call <25/100 near useless?
Firefox Minefield the in development release hits 92/100 even the current version does 70+
Yani
when next i point out whyi use IE dont tell me you use ff cos it did acid test. that is not how you use the web.
In the past few years I have only run into one site that doesn't work in FF well. Autodesk's subscription center doesn't work in FF3. Other than that, though, there's not another site I know of that doesn't work in FF. The site compatibility problems are few and far between now that the browsers are getting more standards compliant, except for Opera.
Sorry to burst your bubble but those plug ins are designed by other people so how exactly is that FF innovating?
Typically, though, as programming technologies mature,
they settle into standards and get more refined tools.
Sorry, JavaScript has been around for years, and there have been standards. Some of the browser makers have been good about complying with the standards and others have not (hello Microsoft). It's not a question of developing the standards, it's a question of browser makers caring about following the standards.
For example, in HTML4 there is no iframe... why wasn't it included as a standard? Many websites support it and there's so many things you can do with it especially when Ajax wasn't around yet. By the way, the concept of doing an asynch xml post (MSXML), hence the foundation of Ajax, has been there in IE long before FF and the standards adopted it...
If FF is so pure, why did it chose to accept and render iframe? Because it makes sense. Standards bodies can be blind sometimes. I sometimes think they did not make iframe as a standard just because it's Microsoft. (I and a lot of people I know have tried very hard and failed to use the recommended Object tag to do what iframe is supposed to do just to comply with the standards.)
Read the history of Ajax:
http://en.wikipedia.org/wiki/Ajax_(programming)... Here's a peek:
In 1999, Microsoft created the XMLHTTP ActiveX control in Internet Explorer 5. This is now supported by Mozilla, Safari and other browsers as the native XMLHttpRequest object.[8][7] On April 5, 2006 the World Wide Web Consortium (W3C) released the first draft specification for the object in an attempt to create an official web standard.[9]
So you see, for Ajax IE was 6 years ahead of w3c.... So what are we supposed to do if a functionality isn't yet a standard?... You know how slow these organizations act?
You can achieve whatever you can achieve in Ajax (async call to the server after the page is already loaded) using IFRAME since 1996.
Where was FireFox during those times? FFv1 was in 2004.
I'm going to have to call BS on that one. Netscape had many de-facto standards as well, which IE doesn't support. Firefox and Safari frequently adopt advanced tech in their rendering engines that never shows up on web pages unless you see it. The difference here is that while the other browsers work to make sure what they're doing isn't in conflict with existing web practices, Microsoft simply didn't care. Now that the Internet is moving towards those web standards (finally), Microsoft is in a position where they either have to break backwards compatibility or give all the webmasters out there working towards the standards in hope that their pages won't break in the future the finger.
While we're on the topic of bias in W3C, I'd like to point out that W3C committees are made up of members from all the companies involved in web standards (yes, this includes Microsoft, Mozilla, Apple, Opera and so on), and volunteers. It's not bias that causes them to "ignore" de-facto standards, it's that frequently there are much better ways of handling the problems than the ways used by the browser makers during the Browser Wars. And Microsoft wasn't the only company that was "ignored"; a lot of stuff from Netscape was rejected too, including the infamous embed tag that you frequently see in web pages nowadays, because Macromedia and Adobe have pushed it as the solution to serving Flash to users. PS, Iframe is in fact in HTML4 and always has been; that's why it is supported by the various browser makers. Besides, frames suck.
As for failing to use the object tag, that is Microsoft's fault; they EE'ed it to serve ActiveX, breaking the standard implementation of it. The reason using object doesn't work is because of IE assuming if it's an object, it HAS to be ActiveX.
"Where was FireFox during those times? FFv1 was in 2004."
Are you attempting to imply that because Microsoft "innovated" in the past (no, not really; they created HttpXmlRequest to make Outlook work with Hotmail, and for no other reason), they should be allowed to do whatever they want now? Yeah, that's great. Let's go back to the days of "Best viewed in" sites and 400 versions of a site needing to be written to handle various browser quirks. Microsoft was INVOLVED in the creation of those same standards you seem so keen on lambasting...
And if you're trying to claim that Mozilla/Firefox never innovates or hasn't given anything to the web, I'd like to point out that, among other things, Mozilla has given the web XBL (a vast improvement over IE's inferior alternative), SVG, a lot of good ideas in HTML5, and various other technologies that are going to play a big part in the future of the web. And unlike Microsoft, they actually use the same technologies they came up with in their own products, rather than shoehorning other stuff into it instead. Oh, and before anyone says "Mozilla didn't come up with those!", their members were on the committee's for formulating the concepts behind the technologies, so they were at least involved, which is the point I'm trying to make. As for "not knowing about any of these", you can thank Microsoft again. SVG would be much more common on the web if IE supported it, as it is the only major browser that doesn't at this point. So would MathML and true XHTML, along with the high level DOM and CSS interfaces.
I'm not trying to lambast anyone or anything. Please don't put words into my mouth. Yes, Microsoft is represented in w3c... but obviously they don't have much influence on it as they are heavily outnumbered. Like most standards bodies they have a political component -- that's just what I was trying to say.
Anyway, I was just trying to offer my thoughts on why Microsoft might have decided the way it did in so far as supporting (or not supporting) standards.
Remember that Safari, FireFox and Chrome are all relatively new browsers... So they are not duty-bound to make their browser compatible with existing code/pages. IE is not just about the Internet but also for the enterprise too, so any changes it does can cost serious amount of money for its ISVs. IE is embedded in a lot of desktop applications too.
I'm on a Mac and use FireFox and I do like using it (most apps I use can't be viewed using Safari). I never tried to imply that they don't innovate... I'm also a software developer (desktop/web/enterprise), and I really appreciate the development tools that are available to FireFox as plugins.
But what I was trying to say is that it's very unfair to judge Microsoft harshly just because it didn't support standards... Microsoft is duty-bound to support its customers, especially those apps that run apps for financial systems first, for example.
Oh, yeah, HTML4 supports IFRAME? Not really since it's in the HTML 4.01 Transitional section (as opposed to Stict)... almost any tag is in transitional... e.g. even tags in all-capital letters are approved in that "standard". That's hardly a stamp of standards approval to me.
the future web application will be written in Silverlight. i hope javascript will be gone for good. performance aside, 1. no code should be sent to the user without knowing it even works. how do you do that with javascript. 2. can you imagine you put your business logic into javascript.
any real software engineer out there?
Most of what javascript does is for rendering UI and retrieving data after the page has loaded. Yes, business logic should not be exposed in the javascript, especially sensitive ones (I took an online exam one time and the answer was in the javascript code! It was the first time I cheated -- and that's only because I can in that case).
Yes, development should almost always be in 3-tier (presentation, business logic and data should be separate and independent of each other)... and javascript should always be in the presentation layer. But it comes down to an engineering decision.
And yes, as a developer (many can actually be called inventors), you always tend to be worried about somebody stealing your code... and javascript makes it very easy to do that.... but now it seems, if you code in javascript, just give a silent sigh and offer it as your contribution to open source -- after all, you are also most likely to be on the receiving end of it as well.
if you know how to cheat like that, you are up to what you said. i offer two more point here. 1. javascript should be limited in presentation layer, but if strictly follow that, there is no way to achieve thing this article mentioned with javascript alone. AJAX for example, if you just retrive a city list or something like that, fine. anything more, there should be logic to understand the data you get from the backend. google webtool as i meantioned, generates a whole chuck of javascript to the client even for a very simple page. that why i say things like Silverlight should be encouraged to use. and as a matter of my opinion, it should be the future. i could write a lot more about why.
2. it's not only about exposing your code. it's about code an application engineering way. javascript for most part, is just for convience, because it is there, it works and people use it. it is not what it is supposed to be. if the future of web is going to be platform for application, not just browing. there is has to be better way than javascript? make javascript better? don't think so.
"That is exactly the reason why JavaScript 2 will have proper class syntax and proper OO behavior".
As far as I know this isn't the case. This went out the door when JS 2 was killed in favor of 'Harmony'. It would have been nice though.
Better for MS to release versions of VBscript that run on Macs and linux than to continue to support the mess that javascript is, and is trying to become. OO implies huge libraries of base objects that all need to be downloaded before the page loads, or downloaded when referenced What a dogs breakfast that will become.
And MS should be out there with a decent browser based database engine as well. Maybe roll all of that into silverlight and build it all into the browser as i noted above.
What, they didn't like the results?
You'd think that they'd want to discount Apple's (probably false) statement that Safari 4 is the "World's fastest web browser". Then again, maybe Apple's claim is right, otherwise what is Microsoft hiding?
Also, I think it's funny that they're comparing IE 8 to Chrome 1.0. That's hardly fair either, Chrome 2.0 has been out for 2 months before IE8. (Same goes for Apple, on their website, they compare Safari 4 with Chrome 1.)
Has anyone seen any independent speed tests? It'd be interesting to compare the load times of these 25 most popular sites as compiled by someone other than Microsoft, Google, Apple, or Mozilla.
- by Leechman March 23, 2009 7:03 AM PDT
- Jesus Christ, people, don't you recall what happened the last time Microsoft was pushing performance? They argued that scripted or interpreted languages in browsers were too slow, and that you had to be able to download plugins from websites and run them directly in the browser without a sandbox. That led directly to the biggest virus and worm disasters ever, starting in 1997 when they introduced Active Desktop.
- Like this Reply to this comment
-
Showing 1 of 2 pages (61 Comments)Microsoft needs to prove that whatever they're doing isn't compromising security. Preferably by releasing source code.