<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=windows-1250">
<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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="PL">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="PL"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="PL">After detailed checking, I think this results are ok. The benchmarks use 1024 array size, and increase in time is caused but checking segments. Numbers looks similiar when used with bigger sizes like 1M.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="PL"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="PL">Sorry for noise and please ignore this thread.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="PL"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="PL">Kind regards</span>,</p>
<p class="MsoNormal">Radoslaw Smogura</p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:mail@smogura.eu">Radosław Smogura</a><br>
<b>Sent: </b>Wednesday, August 24, 2022 10:02 PM<br>
<b>To: </b><a href="mailto:panama-dev@openjdk.java.net">panama-dev@openjdk.java.net</a><br>
<b>Subject: </b>Slower loops for vector memory segment access (loop unrolling)</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I hope you have a good day!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">During [1], I’ve noticed that directSegments benchmark is slower then arrayCopy one. However expected behavior is that both benchmarks should produce similar results.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I tracked it to int vs long loops - array copy produces same results when int loop is replaced by long counted loop.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I gathered generated graphs [2] where, first benchmark is unrolled 8 times, while 2<sup>nd</sup> one (with long loops) 4 times only.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For now I don’t know exact reasons while there’s such difference.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[1] <a href="https://github.com/openjdk/panama-foreign/pull/711">
Split foreign vector load and store by null or not null base by rsmogura · Pull Request #711 · openjdk/panama-foreign (github.com)</a><o:p></o:p></p>
<p class="MsoNormal">[2] <a href="https://drive.google.com/drive/folders/1gaNz4qwc0e1un6oy7WunTHnYdBdKMIAb?usp=sharing">
https://drive.google.com/drive/folders/1gaNz4qwc0e1un6oy7WunTHnYdBdKMIAb?usp=sharing</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards,<o:p></o:p></p>
<p class="MsoNormal">Radoslaw Smogura<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>