<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 <<a href="mailto:moagrawa@redhat.com">moagrawa@redhat.com</a>> 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'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">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>