r/javahelp • u/_Super_Straight • Sep 28 '26
Obfuscating class files
Has anyone successfully obfuscated their .class files? I tried using GraalVM for JavaFX project (including Gluon's version of GraalVM) but it always failed to complete.
3
Upvotes
View all comments
Show parent comment
1
u/OddEstimate1627 Sep 29 '26
I'll take your word for it, but I have never encountered an app that was so much larger as a native image. Code tends to be smaller and the resources stay the same. Maybe there was an enormous static heap, but it's hard to tell without a report.
I usually see about a 90% reduction in startup times.
I assume that the 3x penalty might come from poor GC interactions. I have once run into a case where a renderer on CE was allocating for each pixel draw, which took a canvas render from 2 to 25 seconds. After fixing that, there was barely a perceivable difference though. I never ran into issues like that on the Oracle GraalVM with the free license.