<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">I am confused. It seems that my replies are detached from the mailling list. It that expected?<br>
</span></div>
<div class="elementToProof">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<img style="width: 119.816px; height: 29px; max-width: initial;" width="119" height="29" data-outlook-trace="F:1|T:1" src="cid:c701634b-974a-4880-b982-6536b5c875d0"><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;">Schrodinger ZHU Yifan, Ph.D. Student</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;">Computer Science Department, University of Rochester</span></div>
<div class="ContentPasted0"><br>
</div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"><b>Personal Email:</b></span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"> i@zhuyi.fan</span></div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"><b>Work Email:</b></span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"> yifanzhu@rochester.edu</span></div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"><b>Website:</b></span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"> https://www.cs.rochester.edu/~yzhu104/Main.html</span></div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"><b>Github:</b></span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"> SchrodingerZhu</span></div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"><b>GPG Fingerprint:</b></span><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 10pt;"> BA02CBEB8CB5D8181E9368304D2CC545A78DBCC3</span></div>
<div class="ContentPasted0"><span style="font-family: "Calibri Light", "Helvetica Light", sans-serif;"><br>
</span></div>
<img style="width: 139px; height: 29px; max-width: initial;" width="139" height="29" data-outlook-trace="F:1|T:1" src="cid:d126ffb1-dd3b-4bf6-955f-f3cbfc8c2035"><br>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>发件人:</b> panama-dev <panama-dev-retn@openjdk.org> 代表 Paul Sandoz <paul.sandoz@oracle.com><br>
<b>发送时间:</b> 2023年1月6日 0:29<br>
<b>收件人:</b> Zhu, Yifan <yzhu104@UR.Rochester.edu><br>
<b>抄送:</b> panama-dev@openjdk.org <panama-dev@openjdk.org><br>
<b>主题:</b> [EXT] Re: Follow-up results for SwissTable with Vector API</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi,<br>
<br>
I saw you sent another email prior to this, but for some reason it got lost by the moderation system. (Since you are not a member of the list the emails need to be moderated and approved.)<br>
 <br>
<br>
> On Jan 5, 2023, at 8:09 AM, Zhu, Yifan <yzhu104@UR.Rochester.edu> wrote:<br>
> <br>
> This is the following up message for <a href="https://urldefense.com/v3/__https://mail.openjdk.org/pipermail/jdk-dev/2023-January/007288.html__;!!CGUSO5OYRnA7CQ!c6-WVSHfkvXgbKEtNWhxgdZ9EHDDMbmUz9AbxpvbYN54xt_4LzTwYJd4PdHmueDBCmryWsWBXfjE-Jpw_Cfrf6WyAw$">
https://urldefense.com/v3/__https://mail.openjdk.org/pipermail/jdk-dev/2023-January/007288.html__;!!CGUSO5OYRnA7CQ!c6-WVSHfkvXgbKEtNWhxgdZ9EHDDMbmUz9AbxpvbYN54xt_4LzTwYJd4PdHmueDBCmryWsWBXfjE-Jpw_Cfrf6WyAw$</a> .<br>
> <br>
> > You do:<br>
> >  converted.intoMemorySegment(MemorySegment.ofArray(control), offset, ByteOrder.nativeOrder());<br>
> ><br>
> > Can you just do: <br>
> ><br>
> >  converted.intoArray(control, offset);<br>
> <br>
> <br>
> I did so because I found that Vector<Byte> actually does not have that method.<br>
<br>
Ah, yes. There could be an perf issue with memory segment access, although since you had to wrap the array in a segment there will be some cost to that. It’s like if you wrapped the control array in a segment and stored in a field it would work better.
<br>
<br>
<br>
> After your suggestion, I switched to use ByteVector instead by Vector<Byte>. Surprisingly, this time the hashmap delivers a better performance. It 2~3 times faster during the insertion procedure.
<br>
<br>
Good!<br>
<br>
<br>
> However, there was still a performance gap behind the standard hashmap during finding precedure.<br>
> <br>
> For the ease of discussion, I attach the relevant code here:<br>
> <br>
> private int findWithHash(long hash, K key) {<br>
>     byte h2 = Util.h2(hash); //highest 7 bits<br>
>     int position = Util.h1(hash) & bucketMask; // h1 is just long to int<br>
>     int stride = 0;<br>
>     while (true) {<br>
>         var mask = matchByte(position, h2).toLong(); // match byte is to load a vector of byte and do equality comparison<br>
>         while (MaskIterator.hasNext(mask)) { <br>
>             var bit = MaskIterator.getNext(mask);<br>
>             mask = MaskIterator.moveNext(mask);<br>
>             var index = (position + bit) & bucketMask;<br>
>             if (key.equals(keys[index])) return index;<br>
>         }<br>
> <br>
>         if (matchEmpty(position).anyTrue()) {<br>
>             return -1;<br>
>         }<br>
> <br>
>         stride += VECTOR_LENGTH;<br>
>         position = (position + stride) & bucketMask;<br>
>     }<br>
> }<br>
> From Intellij IDEA's profiler, it seems that a large portion of time is spent on building the vectormask. I see there is an underlying bTest operation converting the results to boolean array and then give the mask. Will this be internally optimized to a single
 movemask operation by JVM?<br>
> <br>
<br>
Can you get an inline/compilation trace like you did for insert?<br>
<br>
The VectorMask.toLong method is an intrinsic method.<br>
<br>
Try:<br>
<br>
  var vmask = matchByte(position, h2);<br>
  var mask = mask.toLong();<br>
<br>
Probably will not make any difference, but if the findIInsertSlot performed ok operating on the mask returned from matchEmptyOrDelete it points to an issue with VectorMask.toLong.<br>
<br>
Paul.<br>
 <br>
> <br>
> <Outlook-ejiaczyb.png><br>
> Schrodinger ZHU Yifan, Ph.D. Student<br>
> Computer Science Department, University of Rochester<br>
> <br>
> Personal Email: i@zhuyi.fan<br>
> Work Email: yifanzhu@rochester.edu<br>
> Website: <a href="https://www.cs.rochester.edu/~yzhu104/Main.html">https://www.cs.rochester.edu/~yzhu104/Main.html</a><br>
> Github: SchrodingerZhu<br>
> GPG Fingerprint: BA02CBEB8CB5D8181E9368304D2CC545A78DBCC3<br>
> <br>
> <Outlook-3nrq0klq.svg><br>
<br>
</div>
</span></font></div>
</body>
</html>