<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannera83ap20 { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important;
    background-color: #60beeb !important;
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtona83ap20:hover, .pfptPrimaryButtona83ap20:focus {
    background-color: #77a8c4 !important; }
  .pfptPrimaryButtona83ap20:active {
    background-color: #8193a0 !important; }
  html:root, html:root>body { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
Hi, I'd like to request a review for a C2 optimization for String. format() and String. formatted() with simple format strings: https: //github. com/openjdk/jdk/pull/29915 Summary ------- When String. format() or formatted() is called with a compile-time</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 0px 0px 10px 0px; direction: ltr" lang="en"><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 6px 8px; width: 100%; border-radius:4px; border-top:4px solid #8193a0;background-color:#60beeb;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 4px 8px; font-size: 12px; line-height: 16px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; line-height: 20px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>
      <![if ie]><br clear="all"><![endif]>
      <table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px; font-size: 14px; line-height: 36px"><tr>
        <td style="direction: ltr">  <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!Op26VwOk-2Jun7PqXVPUeBkVF0qHaAqp9PwTNBd9Wb7IfLKod1tZ6G63daQVQbw1BVwa9gTCNPnulr8I_u6kFwDz9Et59K0QIgZMvqlwQ2FyQrfmKs_GXnZXSCxSQnGe3A$" style="mso-padding-alt: 7px; padding: 7px; border-radius: 2px; border: 1px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size: 14px;">  Report Suspicious  </strong></a>  ‌ </td>
      </tr></table>
    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr" lang="en" id="pfptBannera83ap20" style="all: revert !important; display:block !important; text-align: left !important; margin: 0 0 10px 0 !important; padding:7px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #60beeb !important; background-color: #60beeb; border-top: 4px solid #8193a0 !important; border-top: 4px solid #8193a0;">
    <div id="pfptBannera83ap20" style="all: unset !important; float:left !important; display:block !important; margin: 1px 0 1px 0 !important; max-width: 600px !important;">
      <div id="pfptBannera83ap20" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:1.29 !important; line-height:1.29">
        This Message Is From an External Sender
      </div>
      <div id="pfptBannera83ap20" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:1.5 !important; line-height:1.5; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>
    <div id="pfptBannera83ap20" style="all: unset !important; float: right !important; display: block !important; display: block; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important">
<a id="pfptBannera83ap20" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!Op26VwOk-2Jun7PqXVPUeBkVF0qHaAqp9PwTNBd9Wb7IfLKod1tZ6G63daQVQbw1BVwa9gTCNPnulr8I_u6kFwDz9Et59K0QIgZMvqlwQ2FyQrfmKs_GXnZXSCxSQnGe3A$"
    style="all: unset !important; display: inline-block !important; text-decoration: none">
    <div class="pfptPrimaryButtona83ap20" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important;  font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; margin-top: 3px !important; margin-bottom: 3px !important; margin-left: 16px !important; padding: 7.5px 16px !important; white-space: nowrap !important; width: fit-content !important;
        border: 1px solid #666666">
        Report Suspicious
    </div>
</a>
    </div>
    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div class="__aliyun_email_body_block"><div  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div  style="clear: both;"><span >Hi,</span></div><div  style="clear: both;"><br ><div  style="clear: both;">I'd like to request a review for a C2 optimization for String.format()</div><div  style="clear: both;">and String.formatted() with simple format strings:</div><div  style="clear: both;"><br ></div><div  style="clear: both;"><a  href="https://github.com/openjdk/jdk/pull/29915" target="_blank">https://github.com/openjdk/jdk/pull/29915</a></div><div  style="clear: both;"><br ></div><div  style="clear: both;">Summary</div><div  style="clear: both;">-------</div><div  style="clear: both;">When String.format() or formatted() is called with a compile-time constant format string containing simple specifiers (%s, %d, %x, %X), this optimization</div><div  style="clear: both;">bypasses the java.util.Formatter overhead and directly builds the result string.</div><div  style="clear: both;">The C2 compiler recognizes these calls during the Parse phase and redirects them to specialized fast-path methods in java.lang.String.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Performance</div><div  style="clear: both;">-----------</div><div  style="clear: both;">Benchmarks show 2.6x - 4.3x speedup for common patterns:</div><div  style="clear: both;">  "Hello %s".formatted(name)        -> 3.75x faster</div><div  style="clear: both;">  "%s: %d".formatted(key, value)    -> 2.62x faster</div><div  style="clear: both;">  "%s %s %s %s".formatted(...)      -> 2.68x faster</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Fallback</div><div  style="clear: both;">--------</div><div  style="clear: both;">The optimization only applies to simple cases. Complex format strings (width > 9, precision, most flags, non-constant format) fall back to the existing Formatter implementation.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Testing</div><div  style="clear: both;">-------</div><div  style="clear: both;">- JMH microbenchmarks verify performance improvement</div><div  style="clear: both;">- jtreg functional tests cover optimized and fallback paths</div><div  style="clear: both;">- IR tests verify correct C2 code generation</div><div  style="clear: both;"><br ></div><div  style="clear: both;">I would appreciate any feedback on the approach or implementation.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Thanks,</div><span >Wenshao</span></div></div></div>