Fork me on GitHub
#clojure-dev
<
2016-01-09
>
ghadi21:01:12

taking a new approach with CLJ-1458 merge / merge-with + transients

ghadi21:01:45

going to pull merge-with out of the ticket. i'm sure no one will care. merge is the low hanging fruit, far more commonly used.

ghadi21:01:41

was going to do the merges using reduce-kv, but because of https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6554-L6563 it's not clear that PHMs go through the fast path using reduce-kv

ghadi21:01:11

so I'm going to check for clojure.lang.IKVReduce directly

ghadi21:01:41

perhaps, too, reduce-kv can check for IKVReduce directly

ghadi21:01:51

similar to how reduce checks for IReduceInit

bronsa22:01:09

that's worrying, there's no guarantee that reduce-kv on maps will be any faster than reduce 😕

ghadi22:01:33

relatedly @bronsa I made a slight compiler optimization for ifs where the test expression is constant. it will get rid of the branch

bronsa22:01:50

I think there's already a ticket for that

ghadi22:01:56

for use inside stuff like cond blocks with :else

bronsa22:01:59

helps with cond right?

ghadi22:01:05

got a link?

bronsa22:01:13

searching (<3 jira)

ghadi22:01:10

lol, almost char-for-char exact to my patch

ghadi22:01:22

great, that's covered.

ghadi22:01:11

I'll file a ticket for 1) PHM kv-reduce doesn't go through its fastpath of IKVReduce =( 2) records don't IKVReduce at all

ghadi23:01:01

and updated the transient merge patch.