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

Issue 9873023: Fix performance regressions due to lazy initialization. (Closed)

Created:
8 years, 9 months ago by Philippe
Modified:
8 years, 8 months ago
Reviewers:
fschneider, danno
CC:
v8-dev
Visibility:
Public.

Description

Fix performance regressions due to lazy initialization. This CL: - Adds a new trait parameter to LazyInstance to let it initialize the instance without paying the cost of atomic operations (which are expensive on Mac). This only works for users who don't care about thread-safety and this is now the default initialization trait used by LazyInstance in v8. - Reverts the changes that were made in r11010 in isolate.{cc,h}. That lets Isolate's accessors be as cheap as they were before (but adds one static initializer). - Adds OS::PostSetup() used to initialize the math functions which depend on CPU features. That lets the math functions get rid of CallOnce(). BUG=118686 Committed: https://code.google.com/p/v8/source/detail?r=11198

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address Daniel's comments. #

Patch Set 3 : Add OS::PostSetUp(). #

Total comments: 4

Patch Set 4 : Address Daniel's comments. #

Patch Set 5 : Add isolate.cc static initializer back. #

Patch Set 6 : Update check-static-initializers.sh. #

Patch Set 7 : Revert r11010 changes in api.cc. #

Patch Set 8 : Make init traits non-template structs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -109 lines) Patch
M src/api.cc View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M src/isolate.h View 1 2 3 4 4 chunks +20 lines, -12 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 8 chunks +43 lines, -75 lines 0 comments Download
M src/lazy-instance.h View 1 2 3 4 5 6 7 4 chunks +39 lines, -7 lines 0 comments Download
M src/platform.h View 1 2 3 chunks +8 lines, -2 lines 0 comments Download
M src/platform-cygwin.cc View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M src/platform-freebsd.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M src/platform-linux.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M src/platform-macos.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M src/platform-nullos.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/platform-openbsd.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
A src/platform-posix.h View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
M src/platform-posix.cc View 1 2 3 3 chunks +11 lines, -3 lines 0 comments Download
M src/platform-solaris.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M src/platform-win32.cc View 1 2 3 5 chunks +17 lines, -5 lines 0 comments Download
M src/v8.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M tools/check-static-initializers.sh View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Philippe
8 years, 9 months ago (2012-03-28 13:54:31 UTC) #1
danno
It's getting there. Did you run Florian's micro-benchmark with this? https://chromiumcodereview.appspot.com/9873023/diff/1/src/isolate.cc File src/isolate.cc (right): https://chromiumcodereview.appspot.com/9873023/diff/1/src/isolate.cc#newcode319 ...
8 years, 9 months ago (2012-03-29 07:45:16 UTC) #2
Philippe
I didn't run Florian's benchmark as I planned initially since it evaluates Isolate::Current() performance which ...
8 years, 9 months ago (2012-03-29 09:00:48 UTC) #3
danno
https://chromiumcodereview.appspot.com/9873023/diff/1/src/platform-posix.cc File src/platform-posix.cc (right): https://chromiumcodereview.appspot.com/9873023/diff/1/src/platform-posix.cc#newcode137 src/platform-posix.cc:137: if (!fast_##name##_function) { \ Calling it from OS::PostSetUp seems ...
8 years, 9 months ago (2012-03-29 09:07:20 UTC) #4
Philippe
https://chromiumcodereview.appspot.com/9873023/diff/1/src/platform-posix.cc File src/platform-posix.cc (right): https://chromiumcodereview.appspot.com/9873023/diff/1/src/platform-posix.cc#newcode137 src/platform-posix.cc:137: if (!fast_##name##_function) { \ On 2012/03/29 09:07:20, danno wrote: ...
8 years, 9 months ago (2012-03-29 09:26:53 UTC) #5
danno
https://chromiumcodereview.appspot.com/9873023/diff/7014/src/isolate.cc File src/isolate.cc (right): https://chromiumcodereview.appspot.com/9873023/diff/7014/src/isolate.cc#newcode373 src/isolate.cc:373: // becase a non-null thread data may be already ...
8 years, 8 months ago (2012-03-29 12:32:42 UTC) #6
Philippe
https://chromiumcodereview.appspot.com/9873023/diff/7014/src/isolate.cc File src/isolate.cc (right): https://chromiumcodereview.appspot.com/9873023/diff/7014/src/isolate.cc#newcode373 src/isolate.cc:373: // becase a non-null thread data may be already ...
8 years, 8 months ago (2012-03-29 13:06:53 UTC) #7
danno
lgtm
8 years, 8 months ago (2012-03-30 12:07:22 UTC) #8
danno
8 years, 8 months ago (2012-03-30 14:29:53 UTC) #9
lgtm

Powered by Google App Engine
This is Rietveld 408576698