Fork me on GitHub
#clojure-europe
<
2024-01-12
>
dharrigan07:01:43

Good Morning!

schmalz08:01:35

Morning all.

thomas08:01:06

Morning!!! TGIF!!!!

otfrom08:01:28

morning

👋 1
otfrom08:01:22

anyone here moved to JDK21? Is it worth it? Faster?

otfrom08:01:39

I'm on JDK17 atm

Ben Sless09:01:17

I should run my server benchmarks on it :thinking_face:

otfrom09:01:43

that would be interesting

otfrom09:01:48

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.

otfrom09:01:58

it is nice to get some perf for free when you can tho 😉

Ben Sless09:01:43

In that sense you should always upgrade your jdk

Ben Sless09:01:11

The interesting question for Clojure is which JIT compiler you should use, C2 or Graal

otfrom10:01:52

interesting. I've been using ZGC, but this makes me think I should be using something else

Ben Sless10:01:06

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

otfrom10:01:35

sorry, too sleepy to read your response properly

otfrom10:01:06

I should be tuning for throughput as the actual java bits that execute are always batchy

otfrom10:01:36

or (reading further down) ParallelGC

Ben Sless10:01:54

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.

Ben Sless10:01:09

JFR is an excellent tool in debugging these problems. It will yell at you you're doing too many GCs or have long pauses

Ben Sless10:01:54

So download Java Mission Control, attach to your REPL's JVM, and start recording 😄

otfrom10:01:42

does running data science code on my own machine (for clients) count as "production"?

Ben Sless10:01:23

You're dealing with long running computations on your machine? Then Parallel GC might be a better choice

Ben Sless10:01:59

Long running - more than a few seconds

otfrom10:01:12

long running being a few minutes of wall clock time

otfrom10:01:17

so sounds like ParallelGC might be good for me

Ben Sless10:01:42

Yes. But measure 🙂

Ben Sless10:01:54

Lein repl or deps?

otfrom11:01:31

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

Ben Sless11:01:15

You should use clj-async-profiler, too, maybe you'll find some easy fixes

grav08:01:25

Good morning 🙂

vijaykiran10:01:36

Morning 😊

🗻 2
👀 2
❤️ 1
dharrigan10:01:14

Seems like your dog is keeping a very close eye on your mbp...ready to pounce if it even dares beep or move!

vijaykiran10:01:33

😄 he's mostly interested in the ball on the table

reefersleep10:01:21

What a view 😎

yiorgos08:01:27

Is that in Spain?

vijaykiran08:01:40

Nope - in Italy, Biellese Alps

❤️ 1
reefersleep11:01:02

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))

upvote 1
reefersleep11:01:30

Works really well for me.

reefersleep11:01:02

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.