Background Javascript Compilation Boosts Chrome Performance 136
kc123 writes "The latest version of Chrome includes improvements in JavaScript compilation, according to the Chromium blog. Historically, Chrome compiled JavaScript on the main thread, where it could interfere with the performance of the JavaScript application. For large pieces of code this could become a nuisance, and in complex applications like games it could even lead to stuttering and dropped frames. In the latest Chrome Beta they've enabled concurrent compilation, which offloads a large part of the optimizing compilation phase to a background thread. The result is that JavaScript applications remain responsive and performance gets a boost."
Re: (Score:2)
This your first time here?
Performance (Score:3)
Re: (Score:2)
Re: (Score:2)
Re: (Score:1)
It is, but is is done using a non-optimizing compiler to get it going quickly. A second pass is then ran through an optimizing compiler for commonly use segments.
If you had read the fine article you would have known that.
Re: (Score:2)
What is the point of reading the article when other people can do it instead and answer questions for stuff that is not obvious in the summary?
You must be one of the 53%.
Re:Performance (Score:4, Informative)
Chrome's been there, done that (Score:2)
Re: (Score:2)
I thought TypeScript was only available on a Microsoft platform. :-)
Re: (Score:2)
Re: (Score:1)
Is it not compiled as soon it browser receives it?
Obviously it is not. JIT does not mean "javac" in disguise. JIT can be used to optimize runtime performance of a loop as it is executing, something a static compiler never does.
Re: (Score:2)
Re:Performance (Score:4, Informative)
Re: (Score:2)
> the Java JIT compiler can even compile the same code fragment several times, using different optimizations as
> it collects more runtime statistics.
Yes, it can start off optimized for grabbing VISA credit card numbers, but if it notices more Mastercards coming through the keylogger it can adapt accordingly.
Re: (Score:3)
With JavaScript, in most cases, the thing that users care the most about is load time. It's often better to use a simple AST interpreter for JavaSc
Re: (Score:2)
Because the game's UI is a Javascript textbox?
Duh.
History repeats itself (Score:1)
Re: (Score:3)
We have the same performance critical application in both Java and Javascript. After doing many optimizations in JavaScript (and therefore running into several JavaScript JIT compiler bugs in different browser versions!), JavaScript is still much slower. JS is indeed a promise, but only because it is in newborn state if we consider using it for larger applications.
It is not an accident that Google tries to replace JavaScript with Dart, which already outperforms JavaScript and is more suitable for larger ap
Re: Call me... (Score:1)
Dart is a silly idea in an age where we have vms running scripts in browsers. Even Mozilla knows to develop asm.js and let the user choose their language. If people can even use types on ES6 then Dart isn't necessary.
Re: (Score:2)
Still uses more CPU than IE/FF (Score:1)
The fan on my computer keeps going up with 30% CPU usage on my hexcore system when playing youtube or running anything javascript intense on Chrome.
The other 2 browsers do not have this issue. Chrome might win on some artificial benchmarks but GPU acceleration and real usage sap too much CPU and I hate hearing my fan keep blowing when I listen to a simple song. FYI I have an ATI 7850 with about:flags set to use GPU and acceleration when available with CSS, smooth scroll, and other settings. IE and FF turn t
Re: (Score:1)
The fan on my computer keeps going up with 30% CPU usage on my hexcore system when playing youtube or running anything javascript intense on Chrome.
The other 2 browsers do not have this issue. Chrome might win on some artificial benchmarks but GPU acceleration and real usage sap too much CPU and I hate hearing my fan keep blowing when I listen to a simple song. FYI I have an ATI 7850 with about:flags set to use GPU and acceleration when available with CSS, smooth scroll, and other settings. IE and FF turn this on by default and still.
I am typing this on IE 10 for this reason. SIGH
I was with you up until you said IE 10. Everyone knows the Jumper of Chairs rolls IE 11.
Re: (Score:1)
Solution : Unplug fan cable.
Gooby Pls!
Re:Still uses more CPU than IE/FF (Score:4, Informative)
I call bullshit. Just tested this myself:
Chrome Experiments on a CPU intensive page with half screen filled: 23% CPU
Firefox on the same page: 49% CPU
Chrome playing a 1080p Youtube Video: 7% CPU
Firefox playing a 1080p Youtube Video: 3% CPU, Flash plugin for Firefox 8% CPU
In both cases the GPU load appeared identical. Firefox v26, Chrome v32. I don't have IE10 or the flash player plugin for IE9 so it couldn't be tested.
Re: (Score:2)
Re: (Score:2)
Simple, I rarely use Firefox and as such everything is set at defaults. Why do I use it for IE? Because you can't do youtube any other way in IE9.
Re: (Score:2)
You do realize you have to be running dev channel (chromium) to see anything different, right? That aside, I don't see what you did having anything to do with what they did. You're not testing what they are fixing.
Re: (Score:2)
No I'm calling out the generic bull from the parent. Every time they announce a Chrome release some shill comes in and says IE is faster than Firefox and Chrome just like every time they announce a Firefox release someone bitches that Firefox instantly uses 100GB of ram just to display about:blank or some crap like that.
The fact is it's wrong. At least on default setups. If the GP somehow stuffed up his install or loaded some resource hungry plugins than that's his problem. No reason to spread miss-informat
Re:Still uses more CPU than IE/FF - Check plugins (Score:2)
If you've got lots of plugins for Chrome, try disabling most or all of them and see if that makes a difference. Plugins run in the same process as the browser and can add JS code to 'background' pages that are present in memory even when you're not interacting with the plugin.
It doesn't already do this? (Score:1)
Re: (Score:2, Insightful)
As far as I know Firefox already has this feature, and Internet Explorer had it even longer than that. Chrome is no longer the leading web browser, this is a nice illustration of that.
Re: (Score:3)
Is anyone else surprised...?
I sure am. I mean these browsers are so expensive you'd think they'd optimize them for something other than making 8-10 levels of recursive <iframes> work so well for advertiser CDNs. I pay a lot of money for my Chrome license, just like you, and I expect more for my money than just a banner ad pump.
The first rule of UI Thread. (Score:5, Informative)
Do not block the UI thread.
Re: (Score:2)
Re: (Score:3)
How stupid! The concept of multi-threading has been around since the 1950s. [clemson.edu]
Every day now I'm still amazed at how little newer members of the technology community actually know about the history, at least some concept, of where modern computing originated.
Re: (Score:1)
One can always find predecessors for any technology going back to the Flintstones era. Of course, there were many attempts at vector processing, SIMD, instruction pipelining, dual pipelines, speculative execution and so forth going way back to the early days of modern computing. Most of these early efforts were very low-level in nature.
I think the modern concept of threads was solidified by the Mach kernel group at CMU in the late '80s. Chances are, they picked up on some academic research that was worki
In node.js too ? (Score:2)
Maybe in a future revision. This would bee great !
Re: (Score:2)
While I agree that node.js don't have a UI, it still have to balance the time passed to compile and the time passed to execute. AFAIK, node.js use a single thread loop for the execution and probably for the compilation too. I think that dispatching the compilation to a second thread could reduce the latency of the execution thread.
Re: (Score:2)
It's fun for a few small applications, but beyond that, it's got to be horrible. I mean: imagine a server dying on the first uncaught exception...
Re: (Score:2)
AFAIK, uncaught exception is fatal in any language.
Re: (Score:2)
Not in an environment like Tomcat. It will just log the error, and restart the service.
Re: (Score:2)
... restart the service.
Yes, there is many ways to restart an application that died on a fatal uncaught exception. Again this is nothing specific to a language.
Re: (Score:2)
Then again, nodejs is not a language.
Re: (Score:2)
Agree on that. Replace it by Javascript virtual machine in my previous text.
This is the same relation than with Java and his virtual machines implementations:
http://en.wikipedia.org/wiki/L... [wikipedia.org]
Re: (Score:2)
Yeah. I think Java's server options (Tomcat, or one of the lighter ones) are just more suitable as a run-time environment than nodejs for complex projects. Logging, multi-threading, loading the correct libraries, integration with maven (however unpleasant it can be), remote debugging, it all has been worked out pretty well by now. Nodejs is still years behind, it seems to me.
Re: (Score:2)
I don't pretend that Nodejs is comparable to Tomcat or similar options. I just noted that restarting on an uncaught exception, while not included in the Nodejs environment, is technically nothing special in Javascript virtual machine compared to others language. I have do that with a manager application or script in many projects. I will probably try to use systemd to do that in the future.
Re: (Score:2)
I suppose that it's possible to find the same opinion for any language. Actually it seem that Node.js raise in popularity.
Personally, I use it with Qooxdoo, and I found it a more effective solution that PHP for example. Having the same language in the server side and in the client side make the whole thing more coherent and simpler to maintain. I now experiment it for it portability across platforms to control a testing device from a browser.
Too Late (Score:2, Insightful)
I've gone back to Firefox although I hadn't really left it. Why? Spying constantly and most recently disabling extensions without your approval and you have no way to re-enable them. This is because they want all extension developers to use their web store to funnel extensions out to the browsers, creating another fucking walled garden. I think it's not only time to de-Chrome but to de-Google completely, I'm tired of changing policies and them breaking shit just for shits and giggles.
Re: (Score:2)
My biggest question is why all Google products (Chrome, GTalk etc) install a Windows Service. Most other browsers manage well enough without needing a Windows Service?
Re: (Score:3)
So it can automatically install updates (the service has more permissions than the user, so it can write to the program files directory).
I believe Firefox does it too (obviously it only has one service. I have seen Chrome set up multiple things (service and scheduled tasks) in multiple places, it's kinda crazy).
Why no precompiled code? (Score:2)
When its compiled to platform independend sandboxed binaries, why can't the website provide this? This would safe a lot of compiling on the clients.
It's actually about Software Engineering! (Score:2)
Yeah, it's worth a /. article, even if you don't like Google. It's an interesting analysis of an architectural change - what's the best way to do some complicated but common things.
Re: (Score:3)
Re: (Score:3, Insightful)
There are still single core systems that aren't legacy and use java?
Re:This is worth a Slashdot article? (Score:5, Insightful)
What's Java got to do with anything in this article? Except Java and Javascript share common letters in their name.
Re: (Score:2)
What about DWR? http://en.wikipedia.org/wiki/D... [wikipedia.org]
Or ST-JS? http://st-js.github.io/ [github.io]
Re: (Score:2)
What about them? Javascript happens to be the most popular browser language. Java happens to be the most popular typesafe server-side language with the best tooling support.
You forgot to mention GWT, which compiles Java to Javascript as well.
Re: (Score:2)
I don't know who wrote this bot, but the fact that it is adapting its babbling to recent events (like beta) shows that it is evolving, and this is a breakthrough in the area of Artificial Stupidity.
Re: (Score:2)
Except Java and Javascript share common letters in their name.
I like to say that java:javascript::ham:hamster. OK, yeah, I stole it [smashingmagazine.com].
Hey bigmouth (Score:1)
Hey bigmouth
Like calling folks idiots? Like this from you troll http://slashdot.org/comments.p... [slashdot.org]
Prove me wrong dumbass http://games.slashdot.org/comm... [slashdot.org]
It works, & gives folks what they want here (no beta site redirect foisted on them without asking, which is WHY I put it up... they did it to me 1 or 2 times, that beat it, & I gave folks what they wanted).
You're also FREE to *try* to disprove 17 points of FACT that use of custom hosts files gives users more speed, security, reliability, & even
Re: (Score:2)
Fair enough, I do forget to separate the two. I do assume you understood what I meant, though.
Re: (Score:2)
Oh Lord, now that people know they can do this...
Slashdot has officially gone to hell.
Re:This is worth a Slashdot article? (Score:5, Insightful)
It might make things slower, but it still might make things *appear* faster but reducing pauses in the Javascript thread. You might not notice 10 10ms pauses but you'll probably notice a 100ms pause.
Re: (Score:2)
[1] 'Interpreted' in V8 really means compiled with no optimisations.
Re: (Score:3)
For a single-core system, this will make things *slower*.
Unless Chrome checks how many cores/threads are available and acts accordingly.
Re:This is worth a Slashdot article? (Score:4, Insightful)
Multi-core systems have been the norm for consumers for what, 5 years now? Probably longer. One of the biggest complaints about the multi-core trend is that software isn't written to take advantage of it.
So I give you the following food for thought:
- Consumers who care about speed are unlikely to have a 10 year old computer.
- Consumers who have a 10 year old computer are unlikely to complain about the overhead multi-threading has on a single core computer.
Re: (Score:2)
Re: (Score:1)
I've been saying for years that Chrome was pathetic on how it makes poor use of multicore systems.
Javascript and threading being the number one problem.
The number two problem with chrome, click tools-task manager.
Browser 520MB
Tab Gmail: 120MB
Tab Twitter: 253MB
Tab Slashdot.org: 40MB (not Beta)
Tab Youtube: 94MB
GPU Process: 258MB
Plug-in: Shockwave Flash: 126MB
4 tabs open and 1.2GB of ram is consumed. This is a 32bit application.
Chrome needs to:
Enable 64bit mode, so leaking javascript apps like gmail and twitte
Re: (Score:2)
Advertisers live by document.write.
Window.open is required for bookmarklets and reparenting to avoid windows being monitored by their creator.
Yes eval is trouble, but I'd rather see a badge indicating "easy to hack" when "use strict" is not in use. Many sites still use eval, so it's best to single them out vs breaking them.