r/Clojure • u/Borkdude • Oct 13 '25
cljs-str: an almost 300x faster str replacement for ClojureScript
https://github.com/borkdude/cljs-str
74
Upvotes
r/Clojure • u/Borkdude • Oct 13 '25
12
u/Borkdude Oct 13 '25
I should tone down the excitement a little bit. It's much much faster when you use constants in str, but still only 4x faster when you use all variables.
7
u/xela314159 Oct 13 '25
Legend
3
u/StephenxD144 Oct 15 '25
Amazing Borkdude! Thank you so much for all your work!
2
u/pavelklavik Oct 17 '25
Thanks a lot. I have noticed some time ago when I was profiling some heavy ClojureScript code using strings that str was really slow. Browsers put effort to make the + operator fast but str was not using it.
1
u/Jeaye Oct 14 '25
Nice work! This reminds me of
strcatfrom stringer: https://github.com/kumarshantanu/stringerFor Clojure JVM projects, I've used this for a similarly significant speedup in string building.
1
u/torsten_dev Oct 14 '25
Nice work.