Fork me on GitHub
#cljs-dev
<
2018-01-28
>
dnolen15:01:01

@mfikes I think I’ve applied all the MapEntry related stuff

mfikes15:01:16

@dnolen Thanks! This one was recently discovered, and could be a regression for code like (rseq (first {:a 1})) https://dev.clojure.org/jira/browse/CLJS-2484

dnolen15:01:02

k, looking at that one

mfikes15:01:55

It is great that the map entry changes end up being more than just for "correctness". Here is the perf snippet from the news article: Finally, using a dedicated map entry type can lead to performance improvements in some code that works with map entries. For example, in :advanced mode, this code [source,clojure]

(simple-benchmark [m (zipmap (range 100) (range))]
  (reduce (fn [a [k v]] (if (even? v) (+ a k) a)) 0 m) 100000)
runs 11% faster in JavaScriptCore, 18% faster in V8, and a whopping 105% faster in SpiderMonkey. And if you use the dedicated key and val functions instead of destructuring, the V8 performance goes to 44% faster and SpiderMonkey 112%.

dnolen15:01:31

yeah I suspect as much 🙂

mfikes15:01:58

I suppose it is a matter of a dedicated 2-element type being very fast over a generic PersistentVector type that has to delegate to internal arrays and such.