<div dir="ltr">Hi Chris,<div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 16, 2018 at 3:11 PM Chris Muller <<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> Chris,<br>
> If/when we implement this, the idea is to rehash the collection using:<br>
>     HashedCollection rehashAll<br>
> Will this adverse affect your MagmaDictionary's?<br>
<br>
No, but it won't help them at all, either.<br>
<br>
Does anyone know if ReferenceStream automatially rehashes Dictionary's<br>
and Sets when it materializes them?  If not, then the impact of<br>
changing the hash calculation is much higher than if they do.<br></blockquote><div><br></div><div>It has to, because:  Since Object>>#= and Object>>#hash fall back on #== and #identityHash, then Dictionary, Set et al instances are potentially affected by identity.  Therefore on reconstructing a Dictionary,. Set et al instance an unpickler must rehash (*).</div><div><br></div><div><br></div><div>(*) unless it verifies that all elements implement their own #= and #hash, which is intractable in practice; the only ways I can see of verifying that an object does not use #== or #identityHash in its #= and #hash methods are</div><div><br></div><div>a) to analyze the code (impossible for a non-AI unpickler) or,</div><div>b) construct a shallow copy of an object (since lots of #= implementations short-cut via "^self == other or: [...") and simulate #= and #hash, t5o see if #== or #identityHash is sent</div><div><br></div><div>Either of these would slow down unpicking enormously; rehashing invokes #= and #hash any way, but at full execution speed.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Magma does, so no action should be needed for regular Sets and Dictionary's.<br>
<br>
> Or will those be handled some other way?<br>
<br>
However, Magma has another special dictionary called a MagmaDictionary<br>
which is designed to be larger than RAM.  It maintains a reference to<br>
its 'session', which communicates with the server to access the large<br>
dictionary contents straight from the disk.  If I have Intervals in<br>
any of these, I'll have to manually plan to rebuild them from scratch<br>
with a utility script(s), because they don't support rehashing the way<br>
small, in-memory HashedCollections do.<br>
<br>
 - Chris<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>