This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-12
Channels
- # announcements (1)
- # babashka (79)
- # beginners (165)
- # calva (29)
- # cider (20)
- # clara (3)
- # cljdoc (1)
- # cljs-dev (52)
- # clojure (42)
- # clojure-chicago (5)
- # clojure-europe (48)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (19)
- # clojurescript (50)
- # clojureverse-ops (5)
- # conjure (8)
- # datomic (16)
- # depstar (2)
- # events (1)
- # figwheel-main (23)
- # fulcro (26)
- # girouette (41)
- # graalvm (9)
- # heroku (3)
- # honeysql (10)
- # jackdaw (20)
- # lambdaisland (6)
- # lein-figwheel (1)
- # lsp (34)
- # malli (7)
- # meander (3)
- # music (1)
- # off-topic (14)
- # polylith (7)
- # re-frame (14)
- # reitit (8)
- # reveal (15)
- # ring (3)
- # schema (1)
- # sci (15)
- # shadow-cljs (42)
- # spacemacs (1)
- # startup-in-a-month (12)
- # tools-deps (59)
- # vim (1)
- # xtdb (27)
not directly related to cljs dev, but have anyone noticed any performance regressions in Safari/JSC recently? IIRC JSC used to be the most performant engine when benchmarking cljs
@roman01la I haven’t anecdotally, but haven’t done any benchmarks (I run CLJS on JSC with iOS/React Native ). Have you noticed anything?
not sure yet, Safari's devtools doesn't help much to answer the question. Btw is there a way to install an older version of the browser on macOS?
@roman01la I haven't checked recently - what are you observing?
if you looked at persistent data structures directly I think the gap wasn't so significant between JSC & V8
One thing I learned recently is that JSC apparently doesn’t JIT inside of React Native. Only in Safari. Not sure what the implication of that is (if any).
Yes, it’s not new 🙂 I just recently learned that there’s (some) difference between what iOS does inside of Safari and RN. I used to think “it’s the same”.
Yea, I don’t have perf. problems per se. Phones getting faster and faster each year; For most UI stuff you can’t tell the difference at all. And with stuff like Reanimated V2, things really fly anyway (even for UI animation).
I'm observing marginally slower runtime performance, but don't want to blame JSC at this point. Either Safari's DevTools are not reliable at tracing or there's something else.
Browser
but I've just asked, maybe someone knows something, don't want to spend anyones time on that, thanks 🙏
I think I found a bug in transient array map:
ClojureScript 1.10.844
cljs.user=> (def t (transient {}))
#'cljs.user/t
cljs.user=> (doseq [n (range 10)] (assoc! t n n))
nil
cljs.user=> (persistent! t)
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}
it seems like any assoc!
after the transient array map has 8 entries are just dropped
@lilactown This is not a bug, you should always use the return value from transient ops, not rely on their side effects
I see. so I'm inferring that what occurs is at > 8 entries it gets promoted to something other than an array map and thus breaks
same problem will occur with hash maps, vectors etc. you cannot mutate in place safely
> Transients support a parallel set of 'changing' operations, with similar names followed by ! - assoc!, conj! etc. These do the same things as their persistent counterparts except the return values are themselves transient. Note in particular that transients are not designed to be bashed in-place. You must capture and use the return value in the next call. https://clojure.org/reference/transients if you wanted to read where that is mentioned
I know the Clojure transients are much faster, but how do ClojureScript transients work? Do they use JavaScript objects underneath?
they work like the persistent versions, just mutate in place instead of doing the structural sharing thing