This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-06
Channels
- # architecture (2)
- # aws (6)
- # bangalore-clj (3)
- # beginners (7)
- # boot (29)
- # cider (26)
- # cljs-dev (52)
- # cljsrn (1)
- # clojure (249)
- # clojure-dev (9)
- # clojure-italy (2)
- # clojure-norway (3)
- # clojure-russia (178)
- # clojure-uk (30)
- # clojureremote (6)
- # clojurescript (91)
- # core-async (4)
- # cursive (8)
- # datascript (3)
- # datavis (1)
- # datomic (6)
- # emacs (3)
- # figwheel (2)
- # hoplon (14)
- # incanter (6)
- # luminus (8)
- # mount (7)
- # off-topic (22)
- # om (25)
- # onyx (41)
- # pedestal (7)
- # re-frame (9)
- # ring (1)
- # spacemacs (4)
- # sql (1)
- # uncomplicate (1)
- # unrepl (37)
- # untangled (90)
- # yada (77)
@dnolen @favila @rauh to pick on the str
issue, there is a measurable gain in the solution @rauh proposed
current impl is 27% slower in chrome, 73% slower in safari, 80% slower in firefox (on my machine, macbook, no IE)
IMO, it's such a simple change that makes sense even just for the sake of allowing GCC to pre-concat strings and not emitting code like str("some str")
.
It decreased the js code for me by 1.5%, which seems tiny, but a few of those changes... And it adds up.
Here is another one: In destructure
if, instead of checking if the passed val is a map/seq inline (as it's done right now) and instead create a function like ensure-map
we'd decrease size + be about 10% (FF) 30%(Chrome) faster. Significant? No, but a small improvement. (all tested in advanced builds)
Would there be an even bigger benefit to getting rid of macro-generated [].join() alltogether? (using +)
This was my original approach: CLJS-801, but was wrongly implicated in the Safari x.toString() debacle and backed out
https://jsperf.com/cljs-str-perf fixed the error, please re-check results
@thheller Why did you remove the testcase where the str function just returned x
instead of [x].join("")
?
Unfortunately due to dropbox killing public folders I can't get that jsperf working again
but the msg reminded me that ''+[x]
is also an alternative to [x].join("")
to avoid x.toString()
yeah results are mostly unchanged from before, just wanted to be correct. +
is faster by a lot in every engine
Does Firefox use ropes for strings like the other browsers? That might be the reason join
is faster