Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Chrome Google Upgrades

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."
This discussion has been archived. No new comments can be posted.

Background Javascript Compilation Boosts Chrome Performance

Comments Filter:
  • Re:Performance (Score:4, Informative)

    by Darktan ( 817653 ) on Thursday February 13, 2014 @05:57PM (#46241307)
    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.
  • Re:Performance (Score:4, Informative)

    by dshk ( 838175 ) on Thursday February 13, 2014 @06:02PM (#46241341)
    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.
  • by Kaenneth ( 82978 ) on Thursday February 13, 2014 @06:46PM (#46241619) Journal

    Do not block the UI thread.

  • by thegarbz ( 1787294 ) on Thursday February 13, 2014 @08:28PM (#46242317)

    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.

Always draw your curves, then plot your reading.

Working...