Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Issue 10417010: Run Crankshaft on a separate thread. (Closed)

Created:
8 years, 7 months ago by sanjoy
Modified:
8 years, 5 months ago
Reviewers:
danno
CC:
v8-dev
Base URL:
https://chromiumcodereview.appspot.com/10387157
Visibility:
Public.

Description

Run Crankshaft on a separate thread. Hot functions are put on a compilation queue and crankshaft'ed on a separate thread. Slows down performance by three times when turned on (--concurrent_crankshaft) but benchmark numbers aren't affected when the option is turned off. BUG= TEST=

Patch Set 1 #

Total comments: 39

Patch Set 2 : Separate optimizer thread per isolate. #

Patch Set 3 : Set optimize_in_parallel to false by default. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -57 lines) Patch
M include/v8.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/SConscript View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/api.cc View 1 2 chunks +11 lines, -0 lines 0 comments Download
M src/d8.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/factory.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 chunks +11 lines, -1 line 0 comments Download
M src/flag-definitions.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/handles.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/handles-inl.h View 1 4 chunks +22 lines, -0 lines 0 comments Download
M src/isolate.h View 1 5 chunks +6 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 4 chunks +19 lines, -0 lines 0 comments Download
M src/objects.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
A + src/optimizing-compiler-thread.h View 1 1 chunk +40 lines, -9 lines 0 comments Download
A src/optimizing-compiler-thread.cc View 1 1 chunk +115 lines, -0 lines 0 comments Download
M src/runtime.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 3 chunks +44 lines, -35 lines 0 comments Download
M src/runtime-profiler.cc View 1 1 chunk +5 lines, -2 lines 0 comments Download
M src/v8-counters.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M test/cctest/test-debug.cc View 1 1 chunk +10 lines, -3 lines 0 comments Download
M test/cctest/test-deoptimization.cc View 1 5 chunks +11 lines, -0 lines 0 comments Download
M test/cctest/test-heap.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M test/cctest/test-mark-compact.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M test/mjsunit/assert-opt-and-deopt.js View 1 4 chunks +16 lines, -5 lines 0 comments Download
M test/mjsunit/count-based-osr.js View 1 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/debug-script.js View 1 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regress/regress-1118.js View 1 chunk +4 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
danno
First round of comments. BTW, in your CL description, don't include specific details about performance. ...
8 years, 7 months ago (2012-05-22 10:32:19 UTC) #1
sanjoy
I've responded to some of the comments. I'll upload a fixed CL soon. http://codereview.chromium.org/10417010/diff/1/src/api.cc File ...
8 years, 7 months ago (2012-05-22 11:38:55 UTC) #2
sanjoy
8 years, 7 months ago (2012-05-24 11:13:12 UTC) #3
fschneider
On 2012/05/24 11:13:12, sanjoy wrote: Just an idea: Wouldn't it be easier and more productive ...
8 years, 7 months ago (2012-05-24 18:05:17 UTC) #4
danno
I agree. Sanjoy, let's create a branch for the more radical changes like this one. ...
8 years, 7 months ago (2012-05-25 07:29:38 UTC) #5
chunyang.stock
8 years, 5 months ago (2012-07-13 08:24:32 UTC) #6
I have the same idea about 3 months ago. I measured the total optimized
compilation time of some famous test cases. Generally speaking, on Desktop the
optimized compilation time occupied about 2% ~ 3%. Some special case will
occupied more then 10%. And on other slow devices such as phone and tablet, it's
about 5% ~ 6%. 

I did one prototype I have some performance gain. And I prepared to continue to
optimize and propose the implementation but I found this subject is already
being implemented.

Most of my implementation is the same as Sanjoy's code. Some different points
are the following:
  1, I use thread local data to manage the data in Isolate which are shared by
the main thread and the compiler thread such as HandleScope, the Zone etc.
  2, I implemented the parallel compilation support for OSR. 

Danno suggested to create one branch for this subject. So May I help to work at
project? I have 3 years working experience on JVM  JIT compiler and another 2
years experience on another JIT compiler for XSLT language. 
I will contribute all my knowledge if possible. 

thanks.

Powered by Google App Engine
This is Rietveld 408576698