[Guide] How to go from 15 to 100 FPS / Maximising Performance with Fabric [1.15.2 & 1.16.x]

Discussion in 'Player Guides, Tips and Tricks' started by wafflecoffee, Sep 25, 2020.

  1. You may have seen my thread on how to install mods using Fabric.

    However, your performance is sub-par, and any mods you install bring your system to a halt!

    I've got the solutions for you!

    Even if your system is unable to get a full 60 FPS, you can still get pretty close with these changes/additions!

    Throughout this process, I will be comparing the number of frames I get on my system.
    This is an Intel Pentium Silver N5000, with Intel UHD Graphics 605 and 8 GB of memory. Full benchmarks can be found at: https://www.userbenchmark.com/UserRun/33406299.
    The only apps running in the background will be Notepad++, Discord, and ShareX. OS is Windows 10, but performance will get even better if you happen to use Ubuntu or another lightweight Linux distribution (I use Manjaro personally, but I used Win10 for the purposes of this test since most people are using that).

    The testing world is a Creative/Normal Mode singleplayer world. I will be standing stationary at the spawn point.
    Daylight cycle is off and time is set to midnight, to allow mobs to be a variable.
    The Minecraft installation is completely new, except in Test 5.
    Video settings will be default.
    The display is 1366x745 (windowed).
    There is no FPS cap, and VSync is off.
    I will wait at least a couple minutes for FPS to stabilise to what it would normally be.

    TEST 1: Vanilla 1.16.1; 2GB allocated; no steps taken to enhance performance
    FPS ranges from 15 to 30, with an average of 23.

    TEST 2: Vanilla 1.16.1; 2GB allocated; JRE changed to AdoptOpenJDK 15 (OpenJ9, latest)
    FPS ranges from 20 to 35, with an average of 27.

    TEST 3: Fabric 1.16.1; 4GB allocated; JRE changed to AdoptOpenJDK 15 (OpenJ9, latest); no mods installed
    FPS ranges from 25 to 35, with an average of 26.

    TEST 4: Fabric 1.16.1; 4GB allocated; JRE changed to AdoptOpenJDK 15 (OpenJ9, latest); Sodium, Lithium, Phosphor, Fabric API installed
    FPS ranges from 40 to 60, with an average of 45.

    TEST 5: Fabric 1.16.1; 4GB allocated; JRE changed to AdoptOpenJDK 15 (Hotspot, latest); all above mods plus the ~30 or so mods I run typically (including Xaero's, Litematica), plus Depixel and Vanilla Tweaks texture packs
    FPS ranges from 70 to 110, with an average of 95.
    Notable change: in all of the other tests, once the game was started, it took roughly 100 to 150 seconds for FPS to stabilise. With this test, it only took 15 seconds to stabilise.
    This is not a clean installation, nor do I use the default settings. Notably: render distance is 6 instead of 12, and all graphics qualities are on "Low" or "Fast".

    (tl;dr of "Frame Tests: these optimisations made my framerate go from 15 to 100.)

    So what did waffle do to get from 15 FPS to a maximum of over 100?!
    (also: CPU usage went from 97% being used by Minecraft in test 1 to 60% being used in test 5)

    Well, the answer is that everything is in the settings that you use, and what you have installed. Remember: the hardware in these tests did not change at all; only the settings and the software.

    STEP 1: Changing the JRE

    The JRE (Java Runtime Environment) handles all the code that Minecraft sends, and processes it. Minecraft comes bundled with a JRE, but it's very outdated and slow, and overall isn't very reliable.

    If you read my guide on installing Fabric mods, you'll already have the latest version of AdoptOpenJDK installed. While you didn't really need it for installing Fabric, you do need it for your Minecraft client if you want the best performance.

    To switch from Minecraft's bundled JRE 8 to the (newer, harder, better, faster, stronger) AdoptOpenJDK 15, you need to go into the Minecraft Launcher, into your Fabric installation profile. Then, under "More Options", click "Browse" next to "Java Executable".

    From there, you need to navigate to the folder where the JRE is installed. This will be located at C:\Program Files\AdoptOpenJDK\jdk-\bin\javaw.exe on Windows. Make sure it's "javaw" and not java or javac or whatever else is in that folder.
    On Linux, it's ~/Home/USERNAME/jdk-adoptopenjdk/src/jdk-15+36/bin/java (java not javaw!).

    Then, once you save that, your JRE will be switched to the newer, harder, better, faster, stronger JRE!

    STEP 2: Optimising JVM arguments

    JVM arguments, essentially, tell the JRE how to do what it's been told to do. By optimising these to the best that you can, you can reduce the amount of resources Minecraft takes up, and you can make your game run smoother.

    Under the same place where you changed the JDK to AdoptOpenJDK, go to "JVM Arguments". From there, copy-paste the following text into that box:
    -XX:+UseG1GC -Xmx2G -Xms1G -Dsun.rmi.dgc.server.gcInterval=2147483646
    -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20
    -XX:MaxGCPauseMillis=25 -XX:G1HeapRegionSize=32M
    DON'T RUN YOUR GAME YET! These flags as they are currently may potentially harm your performance, possibly severely. Step 2 requires Step 3 to also be completed before it has any significant effect!

    STEP 3: Allocating more memory

    One of the things that Minecraft relies on is memory. This is where everything that the game is using right now is stored.

    Minecraft generally runs better if you give it more memory (not always but usually). The amount of memory you can use is completely dependent upon how much physical memory is in your system.

    To figure out how much memory your system has:
    Windows: Taskbar search > input System Information and scroll down to "Installed Physical Memory (RAM)"
    macOS: Click the Apple logo in the top left and click "About this Mac". It's listed under Memory.
    Linux (Manjaro KDE): Search for and open "System Information".
    This will generally be about 4 to 16GB, depending on your system, but can be higher or lower.

    I recommend using as much RAM as your system has, minus a couple/few GB. For example, my PC has 8GB, so I use 4 to 5GB. I would recommend a minimum of 1GB and a maximum of 8GB.

    To allocate this amount of memory to Minecraft, go back into "JVM Arguments" under your Fabric profile. The beginning 3 flags have the following arguments:

    "-XX:+UseG1GC -Xmx2G -Xms1G"

    The first one should never be modified. As for the other two, they are your maximum and your minimum memory allocated, respectively. Modify the maximum (2nd flag) to have what you calculated earlier; e.g., I would use "-Xmx5G".

    As for the minimum (3rd flag), this can be any number from 1 to the maximum; different numbers give different results for different people, so play around with it a little bit. I personally subtract 2 to 3 from the maximum; I use "-Xms2G" myself.

    Once that's saved, you now have more memory than you would by default! To ensure that you've configured it correctly, start up Minecraft and press Alt + Shift + F3. This will bring up a menu that's more detailed than normal F3. In the top-right, it should say something along these lines:

    "Mem" should be out of the "Xmx" amount (times 1024). If that's correct, you've done it right! Congrats!

    STEP 4: Installing Na/Li/P

    The next step is to install the three performance-enhancing mods by JellySquid, called Sodium, Lithium, and Phosphor. These three mods all target certain aspects of the game, and optimise those aspects.

    Lithium and Phosphor both work with 1.15.2 and 1.16.x; Sodium works with 1.16.x. This is why I recommend using client version 1.16.3; you're able to get the most you possibly can from that version (while still being able to play on EMC). These are approved mods. Place those into your mods folder.

    STEP 5: Tweaking video settings

    The fifth, and final, step to optimising your Minecraft: change around your in-game settings!

    All of your progress is going to be for nothing if your render distance is 32 and your biome blend is 9. :p

    Go into the ESC menu > Options... > Video Settings.

    My personal recommendation is to lower the settings that impact performance to the lowest they can go, and gradually increase them one-by-one and see how they affect your FPS. My personal settings are as follows:

    View Distance - 6
    Graphics Quality - Fast
    Clouds Quality - Fast
    Weather Quality - Fast
    Particle Quality - Low
    Smooth Lighting - Low
    Biome Blend - None [IMPORTANT! On EMC, having this set to anything other than zero has crashed people's games and caused damage! CHANGE AT YOUR OWN RISK]
    Entity Distance - 100%
    Entity Shadows - none
    Vignette - none
    Mipmap Levels - 1x
    Advanced - Chunk Renderer - Multidraw (GL 4.3). Change this to Oneshot (GL 3.0) or (GL 2.0) if you're having weird lag spikes.

    As for VSync and FPS Limit: I personally recommend turning off VSync, and turning on FPS limit, to whatever your monitor's refresh rate is (usually 60 Hz [FPS]). This allows your FPS to reach its highest potential, without hogging up all your computer's resources.

    Turn VSync back on only if you're having issues with screen tearing.

    STEP 6: Closing other applications

    This one seems obvious at a glance, but it needs a mention. If you're still having issues, you might have some unnecessary applications running in the background. Try opening Task Manager / System Monitor and closing apps that take up a lot of memory and CPU usage.

    Just be careful not to close things that are integral to your system running! (*cough cough* don't end System, kernel_task, systemd, etc., I've made those mistakes before so that you don't have to :p)

    It also may be worthwhile, if your computer is the lowest of the low, to switch to a whole other operating system entirely. Windows isn't known for being the most resource-efficient, maybe put a bit of research into Linux and find a distro that works for you. :)


    You're now complete! Share how much your FPS increased by replying below, I'd love to see if/how much this guide has helped! :D

    If anyone has any other optimisations they'd like to share, feel free to, I might add them to this guide! :)
  2. Reserved-- overflow possible
  3. Before making the changes, I was getting 75-80 FPS for the area I was in. After making all the changes, I was getting 85-100 FPS. I had sodium enabled for both.
    wafflecoffee likes this.
  4. I think that's a really good comprehensive list of tweaks one can make for their machine if it struggles with Minecraft at default settings, or even with Optifine installed. :)

    'Tis a shame that Sodium does not support 1.16.3 yet... I look forward to using it with Lithium and Phosphor when it is updated to 1.16.3 however! :D
    wafflecoffee likes this.
  5. Alright, I feel like I'm doing something wrong. I did everything and my FPS is fluctuating between the 30s and 60s constantly. :confused:
  6. Well, this could be due to a number of different reasons. First of all; what framerate did you get before making the adjustments? Is this an improvement or a loss?

    Secondly: what area was this framerate recorded in? My own tests were in singleplayer, and on EMC conditions are quite different. At my own base, I get an average of ~20 FPS without adjustments, and 40 with.

    Third: do you have any other applications running in the background? Whenever I open a new tab on Brave/Chrome/etc with the game open, my game spikes to about three FPS before going back to a stable 40-ish.
  7. My framerate before was usually around the mid 40s I'd say, with some minor fluctuation here and there. So 60s part of this is an improvement, but the lower end is a loss.

    I was first testing on EMC, but then I tried a singleplayer world and the results were basically the same, the only difference being that the fluctuations happened a small bit slower.

    Nothing running in the background.

    I am confusion.:confused:
  8. It depends on your system configuration too, so some people may not really see a difference. I know there's people who have said they get worse performance with Sodium.
    wafflecoffee likes this.
  9. Have you tried Optifine? It seems that for some people Optifine works better, and for others Sodium and friends. :)
    Egeau, Yixomua and wafflecoffee like this.
  10. Update: I am a bit of a silly goose... I realized I didn't have the fabric API downloaded... :p Now that that has been solved, I'm running steadily at 75 FPS! :D
  11. Worth mentioning: If you have a relatively newer version of windows (7 or higher) and a newer flash drive, there's actually a feature on windows, called ReadyBoost, that allows you to convert some of the free space on your flash drive to temporary RAM. I've never tested it in the context of Minecraft, but I have tested it on laptops with a small amount of RAM (~2 GBs) and found it made a big difference with general use.

    It will require reformatting a flash drive, but if you're short on cash or you have a slow computer this could make the difference.

    WARNING: While you can allocate the additional RAM to Minecraft, the computer will be using it for general use as it is essentially an external RAM stick. As a result, unplugging it as long as your computer is on will result in your computer crashing into a blue screen of death. If you need to unplug it, shut down the computer first, remove it, and then reboot.

    Also goes without saying that if you unplug it after shutting it down, you need to fix the allocation settings as provided in the above instructions before launching minecraft out of the launcher, otherwise you could run into some problems if it's trying to grab 4 GBs and you only have 3 available.
    wafflecoffee likes this.
  12. Bump! Added some additional instructions for background processes and Linux :)