clojure 2026-09-15

Did anybody benchmark the compact object headers effects on Clojure when using Java 27?

We turned it on in production when it first came into preview. I remember we saw a small but noticeable drop in heap usage, but I no longer remember the details. That was ages ago. Haven't got JDK 27 in production yet to see if any further changes have happened (we're on JDK 26 in production but with preview features enabled).

🤩 1

Here's my thread about it from about 18 15 months ago: https://clojurians.slack.com/archives/C03S1KBA2/p1749236967041949

Alex Miller (Clojure team) 2026-09-15T21:24:33.323349Z

what I have heard anecdotally in the Java community is numbers in the 10-20% ballpark improvement in startup time and heap size

šŸ‘ 3
šŸ™ 1

That jibes with my (now very vague) recollection of what we saw back when we started using it...

any rough edges? It feels very close to a free* lunch. And by free i presume an enormous amount of work with a very smart idea but that it just lands and works?

Apparently, it just works. I just enabled the JVM switches and restarted stuff at the time. No other changes needed.

sounds like a great friday project. awesome

Alex Miller (Clojure team) 2026-09-15T21:54:32.224829Z

they found a few things when they first released it but that stuff has all been addressed afaik

We upgrade the JDK in production every six months as each new version goes GA and, so far, it's been really smooth sailing for many, many versions.

šŸ‘ 1
Alex Miller (Clojure team) 2026-09-15T21:56:47.475689Z

there may be other talks out there that are newer, but I saw this one in the room and found it to be really impressive in the details https://www.youtube.com/watch?v=9ioh6kprnPE

šŸ‘ 1
Alex Miller (Clojure team) 2026-09-15T21:57:08.848259Z

just really high quality solid engineering work

i’m excited to watch that tonight. thanks

Probably around sun.misc.Unsafe there could be some issues, which will eventually get sorted out when the offsets are corrected, maybe I am also wrong and it will be a non-issue.

Alex Miller (Clojure team) 2026-09-15T22:04:13.068749Z

actually, my bad I'm actually thinking of this slightly newer version! https://www.youtube.com/watch?v=kHJ1moNLwao

Alex Miller (Clojure team) 2026-09-15T22:05:17.659649Z

but those are mostly distinct sets of work so you could watch both if you really want to learn about everything :)

same guy 1 year between. sounds interesting to hear what changes

Alex Miller (Clojure team) 2026-09-15T22:06:50.394389Z

it's really additive - the older one is more about the compact object headers, the latter is about other things they've done since

We had customer benchmarking that showed roughly a 25% reduction in heap use in production settings once we switched to JVM25 and set -XX:+UseCompactObjectHeaders. It was a very big deal for us in terms of user satisfaction at the top end of some of our workloads.

šŸ‘ 3
šŸ‘šŸ» 1

And other than the heap reduction, no perceptible adverse changes. Just a free lunch.

https://github.com/defold/defold/pull/11354 Memory use improved by 5%, performance by 10-17%

šŸ‘€ 2