<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Yes, we can replace currently proposed holder pattern implementation with StableValues when ready, without changes in the proposed Attributes class API.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">Brian Goetz <brian.goetz@oracle.com><br>
<b>Date: </b>Tuesday, 30 April 2024 at 14:44<br>
<b>To: </b>Adam Sotona <adam.sotona@oracle.com>, classfile-api-dev@openjdk.org <classfile-api-dev@openjdk.org><br>
<b>Subject: </b>Re: RFR: 8331291: java.lang.classfile.Attributes class performs a lot of static initializations<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:13.5pt;font-family:"Courier New"">StableValue is coming soon, and the attributes is a great candidate for a lazy StableValue map. 
</span><o:p></o:p></p>
<div>
<p class="MsoNormal">On 4/30/2024 7:58 AM, Adam Sotona wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div id="mail-editor-reference-message-container">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<br>
During performance optimization work on Class-File API as JDK lambda generator we found some static initialization killers.<br>
One of them is `java.lang.classfile.Attributes` with tens of static fields initialized with individual attribute mappers, and common set of all mappers, and static map from attribute names to the mappers.<br>
<br>
I propose to turn all the static fields into lazy-initialized static methods and remove `PREDEFINED_ATTRIBUTES` and `standardAttribute(Utf8Entry name)` static mapping method from the `Attributes` API class.<br>
 <br>
Please let me know your comments or objections and please review the [PR](<a href="https://github.com/openjdk/jdk/pull/19006">https://github.com/openjdk/jdk/pull/19006</a>) and [CSR](<a href="https://bugs.openjdk.org/browse/JDK-8331414">https://bugs.openjdk.org/browse/JDK-8331414</a>),
 so we can make it into 23.<br>
<br>
Thank you,<br>
Adam<br>
<br>
-------------<br>
<br>
Commit messages:<br>
 - added impl comment<br>
 - removed list of predefined attributes<br>
 - move mappers implementations to AbstractAttributeMapper<br>
 - 8331291: java.lang.classfile.Attributes class performs a lot of static initializations<br>
<br>
Changes: <a href="https://git.openjdk.org/jdk/pull/19006/files">https://git.openjdk.org/jdk/pull/19006/files</a><br>
  Webrev: <a href="https://webrevs.openjdk.org/?repo=jdk&pr=19006&range=00">https://webrevs.openjdk.org/?repo=jdk&pr=19006&range=00</a><br>
  Issue: <a href="https://bugs.openjdk.org/browse/JDK-8331291">https://bugs.openjdk.org/browse/JDK-8331291</a></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> CSR: <a href="https://bugs.openjdk.org/browse/JDK-8331414">
https://bugs.openjdk.org/browse/JDK-8331414</a><br>
  Stats: 2029 lines in 47 files changed: 904 ins; 619 del; 506 mod<br>
  Patch: <a href="https://git.openjdk.org/jdk/pull/19006.diff">https://git.openjdk.org/jdk/pull/19006.diff</a><br>
  Fetch: git fetch <a href="https://git.openjdk.org/jdk.git">https://git.openjdk.org/jdk.git</a> pull/19006/head:pull/19006<br>
<br>
PR: <a href="https://git.openjdk.org/jdk/pull/19006">https://git.openjdk.org/jdk/pull/19006</a></span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>