brucethemoose / Minecraft-Performance-Flags-Benchmarks

Sane, Benchmarked Java Flags and Tweaks for Minecraft
MIT License
1.34k stars 29 forks source link

No performance improvements found with GraalVM and these flags #12

Open KB-Q opened 2 years ago

KB-Q commented 2 years ago

I followed this guide, installed GraalVM EE (22.1.0) and used the flags given in the guide to run a 1.19.2 vanilla instance (with performance mods). I'm sad to say I didn't see any performance improvements at all (infact I even experienced game freezes when loading a lot of chunks quickly).

Before this, I used Adoptium's JDK with Aikar's G1GC flags, and I used to get constant lag spikes when generating new chunks. The situation is still the same with GraalVM and these new flags.

These are the flags I used: -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseNUMA -XX:AllocatePrefetchStyle=3 -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M -XX:NonProfiledCodeHeapSize=194M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseVectorCmov -XX:+PerfDisableSharedMem -XX:+UseFastUnorderedTimeStamps -XX:+UseCriticalJavaThreadPriority -XX:+EnableJVMCIProduct -XX:+UseJVMCICompiler -XX:+EagerJVMCI -Dgraal.TuneInlinerExploration=1 -Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.DetectInvertedLoopsAsCounted=true -Dgraal.LoopInversion=true -Dgraal.VectorizeHashes=true -Dgraal.EnterprisePartialUnroll=true -Dgraal.VectorizeSIMD=true -Dgraal.StripMineNonCountedLoops=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.InfeasiblePathCorrelation=true -Dgraal.LoopRotation=true -XX:+UseG1GC -XX:MaxGCPauseMillis=37 -XX:+PerfDisableSharedMem -XX:G1HeapRegionSize=16M -XX:G1NewSizePercent=23 -XX:G1ReservePercent=20 -XX:SurvivorRatio=32 -XX:G1MixedGCCountTarget=3 -XX:G1HeapWastePercent=20 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRSHotCardLimit=16 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:GCTimeRatio=99 -XX:+UseLargePages -XX:LargePageSizeInBytes=2m

The performance mods I used: https://paste.ee/p/JaFLl

My system: Intel i7-8565U CPU Integrated UHD Graphics 620 8 GB total RAM

Allocated memory to Minecraft: (in PolyMC settings) Min: 512 MiB Max: 4096 MiB PermGen: 128 MiB

Any idea what should I do in this case? Please help me with this. Thanks :)

brucethemoose commented 2 years ago

Make your memory allocation static, as described in the guide.

Also try running /sparkc gcmonitor to see if your lag spikes are coming from garbage collection or something else.

Unfortunately, running GraalVM EE has 2 caveats:

Try running regular OpenJDK with the flags, and see if its any better.

Also be sure to try the process priority and SpecialK tweaks if you haven't already.

KB-Q commented 2 years ago

Make your memory allocation static, as described in the guide.

You mean set both the minimum and maximum to the same value?

Try running regular OpenJDK with the flags, and see if its any better.

In that case should I remove any of the flags; especially the -Dgraal ones?

brucethemoose commented 2 years ago

Make your memory allocation static, as described in the guide.

You mean set both the minimum and maximum to the same value?

Try running regular OpenJDK with the flags, and see if its any better.

In that case should I remove any of the flags; especially the -Dgraal ones?

Yeah, use the set for regular openjdk instead of the dgrall ones, and set min/max to the same value.

abrasmag3 commented 1 year ago
  • It doesn't help the client fps at all. It basically only speeds up the internal server...

Does another JRE help more with client FPS, but lack in server FPS? That could be an important thing to note for client instances that are designed to be used with external servers.

brucethemoose commented 1 year ago
  • It doesn't help the client fps at all. It basically only speeds up the internal server...

Does another JRE help more with client FPS, but lack in server FPS? That could be an important thing to note for client instances that are designed to be used with external servers.

JDKs with optimized build flags (like Clear Linux's) may be marginally faster. I'm not aware of any for Windows, though there are some old attempts at that like jdk-mc: https://github.com/ameisen/jdk-mc

Other than that... not that I know of.

What I said may be a little misleading, as GraalVM EE may help with stutters a tiny bit even when connected to servers, but I have seen no JVM variant or JVM flag/tweak that significantly helps raw FPS.