Slashdot Mirror


Background Javascript Compilation Boosts Chrome Performance

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."

7 of 136 comments (clear)

  1. Re:Performance by Darktan · · Score: 4, Informative

    Nope. That's the Just In Time part of the JIT. Javascript can't be (efficiently) compiled to native code until the data types of function arguments are know. Since Javascript is a dynamic language, the types can't be known until the function is actually called.

  2. Re:Performance by dshk · · Score: 3, Informative

    No, JavaScript is not compiled before execution, because that would delay startup. It starts in interpreted mode. Then the runtime environment gradually compiles frequently running code. I do not know how advanced are the JavaScript runners, but the Java JIT compiler can even compile the same code fragment several times, using different optimizations as it collects more runtime statistics.

  3. Re:This is worth a Slashdot article? by viperidaenz · · Score: 4, 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.

  4. Re:This is worth a Slashdot article? by viperidaenz · · Score: 4, Insightful

    What's Java got to do with anything in this article? Except Java and Javascript share common letters in their name.

  5. The first rule of UI Thread. by Kaenneth · · Score: 5, Informative

    Do not block the UI thread.

  6. Re:This is worth a Slashdot article? by thegarbz · · Score: 3, 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.

  7. Re:Still uses more CPU than IE/FF by thegarbz · · Score: 3, 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.