<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>143385</bug_id>
          
          <creation_ts>2015-04-03 14:14:03 -0700</creation_ts>
          <short_desc>Add Options::jitPolicyScale() as a single knob to make all compilations happen sooner</short_desc>
          <delta_ts>2015-04-03 15:53:28 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>benjamin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mhahnenb</cc>
    
    <cc>mmirman</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1082671</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-04-03 14:14:03 -0700</bug_when>
    <thetext>For debugging purposes, sometimes, we want to be able to make compilation happen sooner to see if we can accelerate the manifestation of certain events / bugs.  Currently, in order to achieve this, we&apos;ll have to tweak multiple JIT thresholds which make up the compilation policy.  Let&apos;s add a single knob that can tune all the thresholds up / down proportionately so that we easily can tweak how soon compilation occurs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082672</commentid>
    <comment_count>1</comment_count>
      <attachid>250096</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-04-03 14:19:14 -0700</bug_when>
    <thetext>Created attachment 250096
the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082682</commentid>
    <comment_count>2</comment_count>
      <attachid>250096</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2015-04-03 14:44:00 -0700</bug_when>
    <thetext>Comment on attachment 250096
the patch.

I don&apos;t like this and find it not too helpful.  To come up with a scale, I need to calculate the ration to match the value I want to change.  Right now, I use the values that run-jsc-stress-test sets.  In fact I typically copy them from the output of a failing tests.  The ratio of the various values set in run-jsc-stress-tests wouldn&apos;t work with the same ratio.  For example, thresholdForJITAfterWarmUp is 500 and thresholdForJITSoon is 100 by default.  The &quot;eager&quot; tests set these both to 10, which is a different ratio for each of these parameters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082692</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-04-03 15:04:31 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Comment on attachment 250096 [details]
&gt; the patch.
&gt; 
&gt; I don&apos;t like this and find it not too helpful.  To come up with a scale, I
&gt; need to calculate the ration to match the value I want to change.  Right
&gt; now, I use the values that run-jsc-stress-test sets.  In fact I typically
&gt; copy them from the output of a failing tests.  The ratio of the various
&gt; values set in run-jsc-stress-tests wouldn&apos;t work with the same ratio.  For
&gt; example, thresholdForJITAfterWarmUp is 500 and thresholdForJITSoon is 100 by
&gt; default.  The &quot;eager&quot; tests set these both to 10, which is a different ratio
&gt; for each of these parameters.

To each his own.  In my case, I&apos;m looking to reproduce issues that occur naturally in the wild, but are normally rare.  As such, I would want the policy to reflect the ratios that are used in real world usage, except that I want it accelerated.  This knob gives me a convenient way to tweak that acceleration and re-test my repro case.

The alternative approach you prescribed has 3 disadvantages for my use case:

1. Those jsc stress threshold values don&apos;t reflect the ratios that trigger compilation in the real world.  Hence, it can change the order in which functions are compiled, and is therefore, not necessarily better for reproduction of real world bugs.  Granted, scaling down the thresholds proportionately is not exactly perfect either (especially) when it reaches the very small value, but it is better at preserving the natural order of compilations.

2. It&apos;s a hassle to have to get a fresh run of the jsc stress tests and then hunt down specific tests to copy their policy values out of the generated scripts.

3. It is also a hassle to have to set and tweak multiple option variables instead of one, especially when I do want to preserve the threshold ratios used in the real world.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082703</commentid>
    <comment_count>4</comment_count>
      <attachid>250096</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-04-03 15:44:39 -0700</bug_when>
    <thetext>Comment on attachment 250096
the patch.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082707</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-04-03 15:53:28 -0700</bug_when>
    <thetext>Thanks.  Landed in r182337: &lt;http://trac.webkit.org/r182337&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>250096</attachid>
            <date>2015-04-03 14:19:14 -0700</date>
            <delta_ts>2015-04-03 15:44:39 -0700</delta_ts>
            <desc>the patch.</desc>
            <filename>bug-143385.patch</filename>
            <type>text/plain</type>
            <size>3958</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTgyMzMxKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3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CkBAIC0yMjcsNiArMjI3LDcgQEAgdHlwZWRlZiBjb25zdCBjaGFy
KiBvcHRpb25TdHJpbmc7CiAgICAgdih1bnNpZ25lZCwgbWF4aW11bUJpbmFyeVN0cmluZ1N3aXRj
aENhc2VMZW5ndGgsIDUwLCBudWxscHRyKSBcCiAgICAgdih1bnNpZ25lZCwgbWF4aW11bUJpbmFy
eVN0cmluZ1N3aXRjaFRvdGFsTGVuZ3RoLCAyMDAwLCBudWxscHRyKSBcCiAgICAgXAorICAgIHYo
ZG91YmxlLCBqaXRQb2xpY3lTY2FsZSwgMS4wLCAic2NhbGUgSklUIHRocmVzaG9sZHMgdG8gdGhp
cyBzcGVjaWZpZWQgcmF0aW8gYmV0d2VlbiAwLjAgKGNvbXBpbGUgQVNBUCkgYW5kIDEuMCAoY29t
cGlsZSBsaWtlIG5vcm1hbCkuIikgXAogICAgIHYoaW50MzIsIHRocmVzaG9sZEZvckpJVEFmdGVy
V2FybVVwLCA1MDAsIG51bGxwdHIpIFwKICAgICB2KGludDMyLCB0aHJlc2hvbGRGb3JKSVRTb29u
LCAxMDAsIG51bGxwdHIpIFwKICAgICBcCg==
</data>
<flag name="review"
          id="274923"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>