Question on layer/peeling

Michael Barker mikeb01 at gmail.com
Tue Jan 6 23:04:32 UTC 2015


>
> Great progress!  Can you enumerate the methods or code paths that you had
> to #ifref out, and why?  Then it can form a sort of "scoreboard", where we
> can burn down on the list of accidental hacks as we improve the
> implementation, eventually converging on the desired (hack-free) result.


What is '#ifref'?  Is that a compiler directive?  If so the answer is
none.  The only real issues were the ones mentioned previously.

The code is up on github[1], note that it is not a conversion of
java.util.Map, but a conversion of an open addressed hash map similar to
one that we use internally (specifically it is a port of the one from the
Agrona project[2]).  One of the interesting aspects of the implementation
is that I have to use a BitSet rather than relying on null to determine if
a value is present or now.  I'd replace this with an any-ified value type
for the key or value once value types are ready.

[1]
https://github.com/mikeb01/SpecialisedMap/blob/master/src/github/mikeb01/SpecializedOpenHashMap.java
[2]
https://github.com/real-logic/Agrona/blob/master/src/main/java/uk/co/real_logic/agrona/collections/Long2ObjectHashMap.java


More information about the valhalla-dev mailing list