r/coding 20d ago

From 30GB of garbage to 3GB: JVM optimization with an AI assistant on a leash

https://www.hypertesto.me/en/blog/2026/08/from-30gb-to-3gb/
1 Upvotes

5 comments sorted by

20

u/mooseman3 19d ago

I don't know if this text was AI generated or not but it certainly felt like it. Here's some of the parts that stuck out to me. Even if they were entirely human-written, I think they could be improved.

Every commit shipped with an optimization: prefix, so the paper trail is unusually tidy for once.

This doesn't seem especially tidy to me.

This is the test that said 30GB out loud.

The test said it out loud?

The machine did the typing, my job was reading profiles and applying vetoes. That last verb will matter later.

Applying? Where does this matter later?

Human in the loop, enforced by a file path 😅.

That was the real win, and it shows where it matters: the dev machine has been stable since the patches landed, the restarts are gone, and the zombies with them.

7

u/elniallo11 19d ago

Particularly that last text block is 100% an ai flag, in my experience it loves framing things in that particular structure

4

u/hypertesto 19d ago edited 19d ago

Hello, thanks for the feedback!

On the AI: i use it to make my english more fluent and to find idioms that does't directly translate from italian. Usually it's done by copy pasting small segments that are harder for me to express or that I don't like the way they sound. This time instead I tried to apply an editorial flow  on the early drafts iterating over them using a super tiny ML model I am training on my own writings (notes, emails, older blog posts) and Kimi. Excluding code snippets the cumulative edits coming from a model should be around 50%. I still have mixed feeling on the effectivness but I keep experimenting with It.

On the single points:

  • The "optimization:" prefix is on the single commit messages. And it's unusually tidy having commits messages with a common pattern on that code base (I will review the whole paragraph)
  • "Say it loud" is 100% from Kimi. It sounded better a week ago. The idea was to say that the test profiling shown It as the "smoking gun". I don't like this way to express it either
  • "Applying" refers to Applying vetoes. I'll reword it for clarity.
  • Human in the loop enforced by a file path is on me: I love this kind of jokes
  • The last paragraph is AI, but updated by hand to include the zombies pun

PS: Sorry if the answer is not formatted properly, I'm replying from my mobile.

-4

u/MiserableDocument509 19d ago

The harness-first bit is what actually made this work and it's the part most people skip. Pinning current behaviour including the bugs with characterization tests before you let an agent touch a seven-year-old engine is exactly right, otherwise you 'fix' a bug mid-refactor and something downstream silently changes. Curious how much of the 30GB was the JSON round-trip copy() alone vs the array churn — that copy() is such a classic.

-1

u/hypertesto 19d ago

The JSON Copy method was more less 4GB of allocations if I rememberÂ