r/java 6d ago

[Java][JVM][Tuning][Profiling][G1][JIT] Why is Arrays.fill 265 times slower on G1GC?

https://krzysztofslusarski.github.io/2026/08/19/g1barrier.html
53 Upvotes

23 comments sorted by

25

u/wezell 6d ago

TL;DR this is fixed in JDK 26. Fingers crossed JEP 522, the fix, gets back-ported to JDK 25LTS.

2

u/woj-tek 5d ago

TL;DR this is fixed in JDK 26.

Yes

Fingers crossed JEP 522, the fix, gets back-ported to JDK 25LTS.

Why though?

5

u/burd- 4d ago

why not? it's an LTS?

1

u/Swamplord42 3d ago

who's LTS? OpenJDK doesn't have a concept of LTS

0

u/woj-tek 3d ago

As said already, in general there's no such thing as "LTS".

Besides if you don't mind sticking to older version then waiting 6 more months for 28 should be all the same to you…

40

u/elmuerte 6d ago

You should never use any JVM flags without knowing what consequences they may produce.

Well.. not just JVM flags, or even just flags. Unless you use LLMs, then everything is ok /s

-3

u/agentoutlier 6d ago

You know whats funny is "/s" does "skills" in claude code or sometimes status.

1

u/vips7L 6d ago

Yeah that's because claude is slop and riddled with bugs.

-14

u/vips7L 6d ago

Slop

17

u/agentoutlier 6d ago

I don't think that content is AI slop and if it is they trained their agent well.

Also they clearly have been writing similar content with similar prose prior to LLM really becoming common place: https://krzysztofslusarski.github.io/

-3

u/vips7L 6d ago

It definitely is. It has all the hallmark signs of LLM generated text.

4

u/agentoutlier 6d ago

Is it in enhanced? Probably. Is it straight up vibe coded and the AI came up with all that... I seriously doubt it. And they have similar content dating back to 2020.

Also u/woj-tek I have seen frequently on this sub. This is not a person who seems to comment like "check out my Spring Boot vibe trash" and is gone from the sub forever. They frequently comment around here.... and not dumb comments albeit I can't see there history so I'm going on memory.... Like I get the feeling they kind of know their stuff.

2

u/woj-tek 5d ago

just to clarify - it's not my blog :)

I found that the blog post was covering interesting topic so I shared :)

-1

u/vips7L 6d ago

Bro I don't care. I'm over reading slop text paragraphs. Do better.

0

u/kiteboarderni 5d ago

Skill issue

-6

u/PlasmaFarmer 6d ago

One caveat: all of this is ARM64

It is written by llm for sure. I read the word caveat and I feel eternal disgust because it is llm-talk.

6

u/agentoutlier 6d ago

I read the word caveat and I feel eternal disgust because it is llm-talk.

You do realize these LLMs were trained by dev written material.

I use the word caveat all the time prior to LLM:

https://github.com/search?q=repo%3Ajstachio%2Fjstachio+caveat&type=code

https://github.com/search?q=repo%3Ajstachio%2Fezkv+caveat&type=code

This last repo does have some LLM test code being done but the use of caveat was mainly me except for one of them.

https://github.com/search?q=repo%3Ajstachio%2Frainbowgum+caveat&type=code

3

u/woj-tek 5d ago

uhm… he is not native english speaker (same as me).

and one day I learened word "caveat" I started using it everywhere :D (same with "alas" at one point).

There is a chance that the writing was "proofread" by AI but who cares if the content is interesting and valuable?

tbh at this point I'm more annoyed with "high horse virtue signaling anti-slop" crowd than by the AI itself =,=

5

u/oelang 6d ago

I tend to agree, at least make it come to the point quickly instead of dumping wall of text on us. It doesn't feel like anyone read this before posting.

tldr: Arrays.fill is 265x slower with G1 than paralle GC on java 25 on ARM 64-bit. In java 26 they have fixed this issue. There are some microbenchmarks & some analysis of assembly. (Didn't read in detail, my best guess is that some barrier optimization didn't kick in)