WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
104406
JSC should scale the optimization threshold for a code block according to the cost of compiling it
https://bugs.webkit.org/show_bug.cgi?id=104406
Summary
JSC should scale the optimization threshold for a code block according to the...
Filip Pizlo
Reported
2012-12-07 14:57:55 PST
Patch forthcoming.
Attachments
the patch
(23.07 KB, patch)
2012-12-07 15:01 PST
,
Filip Pizlo
ggaren
: review+
buildbot
: commit-queue-
Details
Formatted Diff
Diff
work in progress
(23.05 KB, patch)
2012-12-07 16:44 PST
,
Filip Pizlo
fpizlo
: review-
Details
Formatted Diff
Diff
the patch
(50.38 KB, patch)
2012-12-08 23:00 PST
,
Filip Pizlo
no flags
Details
Formatted Diff
Diff
the patch
(50.36 KB, patch)
2012-12-08 23:05 PST
,
Filip Pizlo
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Filip Pizlo
Comment 1
2012-12-07 15:01:01 PST
Created
attachment 178289
[details]
the patch
WebKit Review Bot
Comment 2
2012-12-07 15:06:43 PST
Attachment 178289
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/dfg/DFGCapabilities.h:42: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/dfg/DFGCapabilities.h:43: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/dfg/DFGCapabilities.h:44: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/dfg/DFGCapabilities.h:45: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/dfg/DFGCapabilities.h:46: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Source/JavaScriptCore/dfg/DFGCapabilities.h:47: The parameter name "codeBlock" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 6 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3
2012-12-07 15:33:25 PST
Comment on
attachment 178289
[details]
the patch
Attachment 178289
[details]
did not pass win-ews (win): Output:
http://queues.webkit.org/results/15173983
Geoffrey Garen
Comment 4
2012-12-07 15:57:20 PST
Windows export file needs some babysitting: 6>CodeBlock.obj : error LNK2019: unresolved external symbol "public: int __thiscall JSC::CodeBlock::counterValueForOptimizeAfterWarmUp(void)" (?counterValueForOptimizeAfterWarmUp@CodeBlock@JSC@@QAEHXZ) referenced in function "public: void __thiscall JSC::CodeBlock::optimizeAfterWarmUp(void)" (?optimizeAfterWarmUp@CodeBlock@JSC@@QAEXXZ)
Geoffrey Garen
Comment 5
2012-12-07 16:01:19 PST
Comment on
attachment 178289
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=178289&action=review
r=me, please fix comments before landing.
> Source/JavaScriptCore/dfg/DFGCapabilities.h:48 > +bool mightCompileEval(CodeBlock* codeBlock); > +bool mightCompileProgram(CodeBlock* codeBlock); > +bool mightCompileFunctionForCall(CodeBlock* codeBlock); > +bool mightCompileFunctionForConstruct(CodeBlock* codeBlock); > +bool mightInlineFunctionForCall(CodeBlock* codeBlock); > +bool mightInlineFunctionForConstruct(CodeBlock* codeBlock); >
Style bot is right here, for once.
Filip Pizlo
Comment 6
2012-12-07 16:23:05 PST
(In reply to
comment #4
)
> Windows export file needs some babysitting: > > > 6>CodeBlock.obj : error LNK2019: unresolved external symbol "public: int __thiscall JSC::CodeBlock::counterValueForOptimizeAfterWarmUp(void)" (?counterValueForOptimizeAfterWarmUp@CodeBlock@JSC@@QAEHXZ) referenced in function "public: void __thiscall JSC::CodeBlock::optimizeAfterWarmUp(void)" (?optimizeAfterWarmUp@CodeBlock@JSC@@QAEXXZ)
I think it's once again misuse of #ifdef's like ENABLE(DFG.. and so on. :-/ I'm trying to fiddle with it now.
Filip Pizlo
Comment 7
2012-12-07 16:23:13 PST
(In reply to
comment #5
)
> (From update of
attachment 178289
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=178289&action=review
> > r=me, please fix comments before landing. > > > Source/JavaScriptCore/dfg/DFGCapabilities.h:48 > > +bool mightCompileEval(CodeBlock* codeBlock); > > +bool mightCompileProgram(CodeBlock* codeBlock); > > +bool mightCompileFunctionForCall(CodeBlock* codeBlock); > > +bool mightCompileFunctionForConstruct(CodeBlock* codeBlock); > > +bool mightInlineFunctionForCall(CodeBlock* codeBlock); > > +bool mightInlineFunctionForConstruct(CodeBlock* codeBlock); > > > > Style bot is right here, for once.
Yup, I fixed.
Filip Pizlo
Comment 8
2012-12-07 16:44:02 PST
Created
attachment 178303
[details]
work in progress This should make EWS happy.
Filip Pizlo
Comment 9
2012-12-08 16:49:54 PST
Comment on
attachment 178303
[details]
work in progress This causes a massive regression on Kraken audio benchmarks. The regression only shows up in browser. Investigating the reasons now.
Filip Pizlo
Comment 10
2012-12-08 21:53:59 PST
It looks like what is going on is that we've got some code blocks in the Kraken audio benchmarks that rely heavily on OSR exit profiling. Our previous threshold for triggering recompilation was 5000 (thresholdForOptimizeAfterLongWarmUp); this code effectively increases that threshold since we have scaling by instruction count and most code blocks that benefit from recompilation tend to be large-ish. So, I experimented with lowering the thresholdForOptimizeAfterLongWarmUp. With 3000, we already neutralize the slow-down on Kraken. But lowering it further seems to help even more. It looks like setting it to 1000 helps the most. Here are the performance numbers on various benchmarks for 1000, 2000, and 3000: 3000: jsc: 0.7% faster on SunSpider neutral on V8v7 ~1% slower on Kraken drt: 1% faster on SunSpider ~1% faster on V8v7 neutral on Octane 2% slower on Kraken ~10% faster on JSBench 1.5% faster on DSP 2000: jsc: 0.9% faster on SunSpider neutral on V8v7 0.9% slower on Kraken drt: neutral on SunSpider 0.6% faster on V8v7 ~2% slower on Kraken ~7.8% faster on JSBench 1.9% faster on DSP 1000: jsc: 1.4% faster on SunSpider 0.4% slower on V8v7 0.6% slower on Kraken drt: 0.6% faster on SunSpider 1.3% faster on V8v7 neutral on Kraken 1% faster on JSBench neutral on DSP Further tests seem to imply that the speed-up on SunSpider in DRT is closer to 1% with 1000, but I can't be sure. Anyway, 1000 seems best since I'd rather be neutral on Kraken and get a 1% V8v7 & SunSpider speed-up.
Filip Pizlo
Comment 11
2012-12-08 23:00:53 PST
Created
attachment 178396
[details]
the patch I fixed all regressions. It took some effort.
WebKit Review Bot
Comment 12
2012-12-08 23:04:09 PST
Attachment 178396
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/bytecode/CodeBlock.cpp:3110: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/JavaScriptCore/bytecode/CodeBlock.cpp:3115: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Source/JavaScriptCore/bytecode/CodeBlock.cpp:3125: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 3 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 13
2012-12-08 23:05:34 PST
Created
attachment 178397
[details]
the patch fix style
Oliver Hunt
Comment 14
2012-12-09 12:16:49 PST
Comment on
attachment 178397
[details]
the patch View in context:
https://bugs.webkit.org/attachment.cgi?id=178397&action=review
r=me
> Source/JavaScriptCore/profiler/ProfilerDatabase.cpp:61 > + Bytecodes* result = addBytecodes( > + codeBlock->hash(), codeBlock->sourceCodeForTools());
something this short could just be a single line :p
Filip Pizlo
Comment 15
2012-12-09 12:30:27 PST
(In reply to
comment #14
)
> (From update of
attachment 178397
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=178397&action=review
> > r=me > > > Source/JavaScriptCore/profiler/ProfilerDatabase.cpp:61 > > + Bytecodes* result = addBytecodes( > > + codeBlock->hash(), codeBlock->sourceCodeForTools()); > > something this short could just be a single line :p
You make a fair point! Fixed.
Filip Pizlo
Comment 16
2012-12-09 12:43:13 PST
Landed in
http://trac.webkit.org/changeset/137094
Geoffrey Garen
Comment 17
2012-12-10 13:49:31 PST
Should we reconsider these limits, now that
bug 104500
has been discovered and fixed?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug