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

Issue 528013002: Restore in-memory parser cache for V8 compile. (Closed)

Created:
6 years, 3 months ago by vogelheim
Modified:
6 years, 3 months ago
CC:
abarth-chromium, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, gavinp+loader_chromium.org, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Restore in-memory parser cache for V8 compile. Also do a minor refactoring of the decision logic, which hopefully makes it a bit easier to understand. This is a fix for the performance regression introduced by crrev.com/432273004, which inadvertently disabled the parser cache when compiling without any compile options. R=marja@chromium.org BUG=404622 BUG=399580 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181472

Patch Set 1 : #

Total comments: 6

Patch Set 2 : review feedback #

Patch Set 3 : Add unit tests. #

Total comments: 7

Patch Set 4 : bool -> enum. #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -67 lines) Patch
M Source/bindings/core/v8/V8ScriptRunner.cpp View 1 2 3 2 chunks +52 lines, -63 lines 6 comments Download
A Source/bindings/core/v8/V8ScriptRunnerTest.cpp View 1 2 1 chunk +157 lines, -0 lines 16 comments Download
M Source/bindings/core/v8/v8.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/fetch/Resource.h View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M Source/core/fetch/Resource.cpp View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 33 (7 generated)
vogelheim
Yay, the in-memory cache is back!
6 years, 3 months ago (2014-09-02 17:50:59 UTC) #2
haraken
I hope we have a unit test for this feature to prevent future regression. The ...
6 years, 3 months ago (2014-09-03 04:11:44 UTC) #4
marja
I'm not sure whether a unit test is reasonable... this is about configuration (at the ...
6 years, 3 months ago (2014-09-03 07:17:47 UTC) #5
haraken
On 2014/09/03 07:17:47, marja wrote: > I'm not sure whether a unit test is reasonable... ...
6 years, 3 months ago (2014-09-03 07:19:53 UTC) #6
marja
On 2014/09/03 07:19:53, haraken wrote: > On 2014/09/03 07:17:47, marja wrote: > > I'm not ...
6 years, 3 months ago (2014-09-03 07:24:36 UTC) #7
haraken
On 2014/09/03 07:24:36, marja wrote: > On 2014/09/03 07:19:53, haraken wrote: > > On 2014/09/03 ...
6 years, 3 months ago (2014-09-03 07:26:29 UTC) #8
marja
Normally is caught by the morejs warm times regression - just this time it wasn't ...
6 years, 3 months ago (2014-09-03 07:28:35 UTC) #9
vogelheim
https://codereview.chromium.org/528013002/diff/20001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/528013002/diff/20001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode65 Source/bindings/core/v8/V8ScriptRunner.cpp:65: v8::Local<v8::Script> CompileAndProduceCache(v8::Handle<v8::String> code, v8::ScriptOrigin origin, ScriptResource* resource, v8::Isolate* isolate, ...
6 years, 3 months ago (2014-09-03 11:21:34 UTC) #10
marja
lgtm
6 years, 3 months ago (2014-09-03 11:26:40 UTC) #12
vogelheim
I'm undecided on the unit test thing... I certainly see the point of adding tests ...
6 years, 3 months ago (2014-09-03 11:33:04 UTC) #13
haraken
On 2014/09/03 11:33:04, vogelheim wrote: > I'm undecided on the unit test thing... I certainly ...
6 years, 3 months ago (2014-09-03 11:35:49 UTC) #14
vogelheim
Added unit tests. Tests look reasonable now, but took quite a bit of time to ...
6 years, 3 months ago (2014-09-04 17:36:49 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vogelheim@chromium.org/528013002/80001
6 years, 3 months ago (2014-09-05 11:10:35 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/14506)
6 years, 3 months ago (2014-09-05 11:20:51 UTC) #19
jochen (gone - plz use gerrit)
you need to add the test to the resp. gyp file first https://codereview.chromium.org/528013002/diff/80001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp File Source/bindings/core/v8/V8ScriptRunnerTest.cpp ...
6 years, 3 months ago (2014-09-05 11:48:04 UTC) #21
vogelheim
On 2014/09/05 11:48:04, jochen wrote: > you need to add the test to the resp. ...
6 years, 3 months ago (2014-09-05 11:54:01 UTC) #22
vogelheim
https://codereview.chromium.org/528013002/diff/80001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp File Source/bindings/core/v8/V8ScriptRunnerTest.cpp (right): https://codereview.chromium.org/528013002/diff/80001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp#newcode42 Source/bindings/core/v8/V8ScriptRunnerTest.cpp:42: return v8::Isolate::GetCurrent(); On 2014/09/05 11:48:04, jochen wrote: > i'm ...
6 years, 3 months ago (2014-09-05 11:54:12 UTC) #23
jochen (gone - plz use gerrit)
https://codereview.chromium.org/528013002/diff/80001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp File Source/bindings/core/v8/V8ScriptRunnerTest.cpp (right): https://codereview.chromium.org/528013002/diff/80001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp#newcode42 Source/bindings/core/v8/V8ScriptRunnerTest.cpp:42: return v8::Isolate::GetCurrent(); On 2014/09/05 11:54:12, vogelheim wrote: > On ...
6 years, 3 months ago (2014-09-05 14:05:40 UTC) #24
vogelheim
PTAL. Thanks. https://codereview.chromium.org/528013002/diff/80001/Source/core/fetch/Resource.h File Source/core/fetch/Resource.h (right): https://codereview.chromium.org/528013002/diff/80001/Source/core/fetch/Resource.h#newcode201 Source/core/fetch/Resource.h:201: void setCachedMetadata(unsigned dataTypeID, const char*, size_t, bool ...
6 years, 3 months ago (2014-09-05 14:49:01 UTC) #25
jochen (gone - plz use gerrit)
lgtm.
6 years, 3 months ago (2014-09-05 14:50:04 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vogelheim@chromium.org/528013002/100001
6 years, 3 months ago (2014-09-05 14:51:53 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:100001) as 181472
6 years, 3 months ago (2014-09-05 16:01:47 UTC) #29
haraken
Sorry about the review delay. https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode65 Source/bindings/core/v8/V8ScriptRunner.cpp:65: v8::Local<v8::Script> compileAndProduceCache(v8::Handle<v8::String> code, v8::ScriptOrigin ...
6 years, 3 months ago (2014-09-05 16:16:13 UTC) #30
vogelheim
Will send follow-on CL with the actual fixes, since this one is already committed. https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp ...
6 years, 3 months ago (2014-09-05 17:47:29 UTC) #31
haraken
https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp File Source/bindings/core/v8/V8ScriptRunnerTest.cpp (right): https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8/V8ScriptRunnerTest.cpp#newcode23 Source/bindings/core/v8/V8ScriptRunnerTest.cpp:23: cacheTagParser = StringHash::hash(v8::V8::GetVersion()) * 2; On 2014/09/05 17:47:29, vogelheim ...
6 years, 3 months ago (2014-09-05 17:49:39 UTC) #32
vogelheim
6 years, 3 months ago (2014-09-05 17:58:43 UTC) #33
Message was sent while issue was closed.
Follow-on CL is crrev.com/549533002.

https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8...
File Source/bindings/core/v8/V8ScriptRunnerTest.cpp (right):

https://codereview.chromium.org/528013002/diff/100001/Source/bindings/core/v8...
Source/bindings/core/v8/V8ScriptRunnerTest.cpp:23: cacheTagParser =
StringHash::hash(v8::V8::GetVersion()) * 2;
On 2014/09/05 17:49:39, haraken wrote:
> On 2014/09/05 17:47:29, vogelheim wrote:
> > On 2014/09/05 16:16:13, haraken wrote:
> > > 
> > > It is error-prone to calculate the tag value in each call site. Can we
> create
> > a
> > > helper method that returns tagForParserCache() and tagForCodeCache()?
> > 
> > Not sure what you mean: Helper methods in the test fixture (instead of
static
> > members), or helper methods in V8ScriptRunner?
> > 
> > I've done the former.
> > 
> > I don't want to do the latter, since I don't want to use the
class-under-test
> to
> > verify whether the test assertions are correct. That might cause false
> > positives, whenever the same bug affects both the test execution and the
test
> > assertion in the same fashion.
> 
> I was suggesting to add a helper function to V8ScriptRunner and use the helper
> function to get the cache tag in both V8ScriptRunner and the test.

Hmm. I'm not convinced that's a good path since
1, that means the test-under-class is used to verify test assertions, and
2, those methods don't really belong into the V8ScriptRunner public interface.

Powered by Google App Engine
This is Rietveld 408576698