<div dir="ltr"><div dir="ltr">On Thu, May 22, 2025 at 3:31 PM John R Rose <<a href="mailto:jrose@openjdk.org">jrose@openjdk.org</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Update benchmark to reflect new fill method<br>
<br>
Related discussion at the hardware level:<br>
<br>
<a href="https://github.com/openjdk/jdk/pull/25147#issuecomment-2902463076" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/pull/25147#issuecomment-2902463076</a> <br></blockquote></div><div><br clear="all"></div><div>This discussion spurred me to ask a dumb question. Apologies in advance, just trying to learn here...<div><br></div><div>If I do this:</div><div><br></div><div style="margin-left:40px"><span style="font-family:monospace">import java.util.Arrays;<br>public class ArrayFiller {<br> public static void main(String[] args) {<br> while (true) {<br> final byte[] array = new byte[1000000];<br> Arrays.fill(array, (byte)0x42);<br> }<br> }<br>}<br></span></div><div><br></div><div>Will C2 compile <span style="font-family:monospace"><a href="https://github.com/openjdk/jdk/blob/139a05d05959a84541a29dfae6151f92ce579ae6/src/java.base/share/classes/java/util/Arrays.java#L3275-L3308">Arrays.fill()</a></span> into something that is more efficient than a byte-at-a-time loop like what appears in the source code?</div><div><br></div><div>Thanks,</div><div>-Archie</div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>