This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-12
Channels
- # babashka (3)
- # beginners (9)
- # clojure (13)
- # clojure-dev (3)
- # clojure-europe (50)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (3)
- # clojurescript (3)
- # core-async (2)
- # dev-tooling (2)
- # honeysql (4)
- # hyperfiddle (2)
- # kaocha (1)
- # lsp (5)
- # off-topic (18)
- # polylith (4)
- # portal (2)
- # shadow-cljs (19)
- # squint (1)
- # vrac (1)
Morning
I do wonder with benchmarks how much of it depends upon your usecase. I'm doing all batchy/interactive repl stuff using tablecloth and tech.ml.dataset and I've not really got a good idea if it pushes the garbage collector in different ways than other apps (say web apps). I suppose I really ought to profile stuff more.
The interesting question for Clojure is which JIT compiler you should use, C2 or Graal
interesting. I've been using ZGC, but this makes me think I should be using something else
That's for GC, are you tuning for throughput or responsiveness? JIT compilers are orthogonal to that. Highly polymorphic and dynamic code, like Scala and Clojure, seems to benefit more from GraalVMs JIT compiler
I should be tuning for throughput as the actual java bits that execute are always batchy
looking at this makes me think I should use the G1 collector https://docs.oracle.com/en/java/javase/21/gctuning/available-collectors.html#GUID-C7B19628-27BA-4945-9004-EC0F08C76003
Parallel GC is optimized for throughput Shenandoah and ZGC are optimized for responsiveness (short pauses up to no pauses) G1 is a happy median You should use G1 (the default) and profile if you have issues.
JFR is an excellent tool in debugging these problems. It will yell at you you're doing too many GCs or have long pauses
You're dealing with long running computations on your machine? Then Parallel GC might be a better choice
At these speeds I can measure with time
and that reflects how they get used as well as I do all my work in a repl
Seems like your dog is keeping a very close eye on your mbp...ready to pounce if it even dares beep or move!
😄 he's mostly interested in the ball on the table
What a view 😎
As an assistant to just visually diffing merge differences, I like using clojure.data/diff
:
(let [old 'the-old-form
new 'the-new-form]
(clojure.data/diff old new))
Works really well for me.
Treating code as data for ad hoc things is very nice. Like refactoring by quoting some code and calling all your regular fns on it until it's the right, new shape.