<div dir="ltr"><div dir="ltr"><div dir="ltr">Shreyas/Kevin tried to address it some time back using <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1428049">https://bugzilla.redhat.com/show_bug.cgi?id=1428049</a> (<a href="https://review.gluster.org/16830">https://review.gluster.org/16830</a>)</div><div dir="ltr"><br></div><div>I vaguely remember the reason to keep the hash value 1 was done during the time when we had dictionary itself sent as on wire protocol, and in most other places, number of entries in dictionary was on an avg, 3. So, we felt, saving on a bit of memory for optimization was better at that time.</div><div><br></div><div>-Amar</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 12:02 PM Mohit Agrawal &lt;<a href="mailto:moagrawa@redhat.com">moagrawa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">sure Vijay, I will try and update.<div><br></div><div>Regards,</div><div>Mohit Agrawal</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 11:44 AM Vijay Bellur &lt;<a href="mailto:vbellur@redhat.com" target="_blank">vbellur@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Mohit,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 29, 2019 at 7:15 AM Mohit Agrawal &lt;<a href="mailto:moagrawa@redhat.com" target="_blank">moagrawa@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi All,</div><div><br></div><div>  I was just looking at the code of dict, I have one query current dictionary logic.</div><div>  I am not able to understand why we use hash_size is 1 for a dictionary.IMO with the </div><div>  hash_size of 1 dictionary always work like a list, not a hash, for every lookup</div><div>  in dictionary complexity is O(n).</div><div><br></div><div>  Before optimizing the code I just want to know what was the exact reason to define</div><div>  hash_size is 1?</div></div></div></blockquote><div><br></div><div>This is a good question. I looked up the source in gluster&#39;s historic repo [1] and hash_size is 1 even there. So, this could have been the case since the first version of the dictionary code.</div><div><br></div><div>Would you be able to run some tests with a larger hash_size and share your observations?</div><div><br></div><div>Thanks,</div><div>Vijay</div><div><br></div><div>[1] <a href="https://github.com/gluster/historic/blob/master/libglusterfs/src/dict.c" target="_blank">https://github.com/gluster/historic/blob/master/libglusterfs/src/dict.c</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div> </div><div>  Please share your view on the same. </div><div><br></div><div>Thanks,</div><div>Mohit Agrawal  </div></div></div>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="https://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">https://lists.gluster.org/mailman/listinfo/gluster-devel</a></blockquote></div></div>
</blockquote></div>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="https://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">https://lists.gluster.org/mailman/listinfo/gluster-devel</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Amar Tumballi (amarts)<br></div></div></div></div></div>