Fork me on GitHub
#clojure-dev
<
2016-01-28
>
ghadi06:01:23

made some more progress on new hashmaps ^

ghadi06:01:47

assoc, dissoc, get/find, seq, reduce done. Next on the roster is transient impl (straightforward) & iterator (challenging)

ghadi06:01:50

also need a better way to reimplement fold() with perhaps better task forking

spinningtopsofdoom14:01:32

@ghadi: I've made a port of Lean Hash Maps for ClojureScript https://github.com/bendyworks/lean-map

ghadi14:01:00

Oh that was you. Awesome.

spinningtopsofdoom14:01:57

Yep the iteration is pretty straight forward (compared to the current impl) what looks challenging about it to you?

spinningtopsofdoom14:01:55

The tricky part for me right now is getting assoc and dissoc to current perf specs. They are around 2 - 4x slower in some cases right now . The transient assoc! and dissoc! are also pretty slow.

spinningtopsofdoom14:01:41

Feel free to PM if you want help / someone to rubber duck your ideas.

ghadi15:01:55

I wonder why assoc / dissoc are slower. Any theories besides the extra branch?

spinningtopsofdoom15:01:04

AFAICT assoc that requires making a node seems to be the slow down (at least in JS land). If you look at the reference impl you also see that a nodes array can contain 0 - 64 items (32 Key Value pairs) as opposed to 0 - 32 items for the current HAMT implementation.

spinningtopsofdoom15:01:26

so it might be too big for cpu caches

spinningtopsofdoom15:01:34

Another possibility is that it's due to running on JavaScript not the JVM. According to the paper their implementation of assoc / dissoc was comparable to Clojure's. So you might not see what I'm currently seeing

ghadi16:01:53

interesting. size 64 makes sense on javascript w 64 bits