Difference between revisions of "Performance Optimization"

From TerraFirmaCraft Plus Wiki
Jump to: navigation, search
(Prepared the page for translation)
(Marked this version for translation)
Line 2: Line 2:
 
<translate>
 
<translate>
  
== Overview ==
+
== Overview == <!--T:1-->
  
 +
<!--T:2-->
 
Minecraft 1.7.10 is known to have some performance issues compared to other versions, and this is made even worse by the fact that TerraFirmaCraft utilizes the full 256 world height. Your system may be able to play other heavily modded instances of Minecraft with no issues, but when it comes to TerraFirmaCraft it's like comparing apples to oranges. In vanilla Minecraft, as well as 99.9% of all modded Minecraft, the sea-level of the overworld is at y=63. In TFC, sea-level is all the way up at about y=140. That means that in every chunk (which is an area of 16x16 blocks), there are about 20,000 more blocks to load. There are also a handful of other things that make TFC much more resource intensive, so this page is a guide to help make the game run as smoothly as possible. It is strongly recommended that you go through all of the following categories, as they are generally equally important in improving performance.
 
Minecraft 1.7.10 is known to have some performance issues compared to other versions, and this is made even worse by the fact that TerraFirmaCraft utilizes the full 256 world height. Your system may be able to play other heavily modded instances of Minecraft with no issues, but when it comes to TerraFirmaCraft it's like comparing apples to oranges. In vanilla Minecraft, as well as 99.9% of all modded Minecraft, the sea-level of the overworld is at y=63. In TFC, sea-level is all the way up at about y=140. That means that in every chunk (which is an area of 16x16 blocks), there are about 20,000 more blocks to load. There are also a handful of other things that make TFC much more resource intensive, so this page is a guide to help make the game run as smoothly as possible. It is strongly recommended that you go through all of the following categories, as they are generally equally important in improving performance.
  
  
== Java Version ==
+
== Java Version == <!--T:3-->
  
 +
<!--T:4-->
 
First and foremost, you should check which version of Java that Minecraft is running. You can do this on the vanilla launcher by clicking on the tab that says '''Launcher Log'''. If you are using a newer copy of the vanilla launcher, it will likely have come bundled with the correct version of java for your system, but it is still a good idea to check.
 
First and foremost, you should check which version of Java that Minecraft is running. You can do this on the vanilla launcher by clicking on the tab that says '''Launcher Log'''. If you are using a newer copy of the vanilla launcher, it will likely have come bundled with the correct version of java for your system, but it is still a good idea to check.
  
 +
<!--T:5-->
 
Clicking on the tab will show a log that looks like this:
 
Clicking on the tab will show a log that looks like this:
  
 +
<!--T:6-->
 
[[File:LauncherLog.png|File:LauncherLog.png]]
 
[[File:LauncherLog.png|File:LauncherLog.png]]
  
 +
<!--T:7-->
 
On this log there are three values that you should look for:
 
On this log there are three values that you should look for:
 
*os.arch - If you are using a 32-bit or 64-bit operating system.
 
*os.arch - If you are using a 32-bit or 64-bit operating system.
Line 20: Line 25:
 
*sun.arch.data.model - If you are using the 32-bit or 64-bit java. You should be using a version that matches your operating system.
 
*sun.arch.data.model - If you are using the 32-bit or 64-bit java. You should be using a version that matches your operating system.
  
 +
<!--T:8-->
 
The latest version of Java can be found [http://java.com/en/download/manual.jsp here]. Make sure you install the correct one for your operating system, and that you uninstall any older versions of Java your system may be running. x86 is for 32-bit systems, and x64 is for 64-bit systems. ''Note: If you are using a Mac, you may need to keep Java 6 installed.'' If in the program listing, it does not explicitly say 64-bit in the name, it is the 32-bit version.
 
The latest version of Java can be found [http://java.com/en/download/manual.jsp here]. Make sure you install the correct one for your operating system, and that you uninstall any older versions of Java your system may be running. x86 is for 32-bit systems, and x64 is for 64-bit systems. ''Note: If you are using a Mac, you may need to keep Java 6 installed.'' If in the program listing, it does not explicitly say 64-bit in the name, it is the 32-bit version.
  
 +
<!--T:9-->
 
'''''Important:''' Generally speaking, any updates to java that are automatically installed will be the 32-bit version. Each time you update it is crucial that you make sure it installed the correct version.''
 
'''''Important:''' Generally speaking, any updates to java that are automatically installed will be the 32-bit version. Each time you update it is crucial that you make sure it installed the correct version.''
  
 +
<!--T:10-->
 
If you needed to download and install a new version of java, click on Edit Profile on the launcher to make sure that it is going to use this new version. You'll need to point it to where java was installed:
 
If you needed to download and install a new version of java, click on Edit Profile on the launcher to make sure that it is going to use this new version. You'll need to point it to where java was installed:
  
 +
<!--T:11-->
 
[[File:JavaExecutable.png|File:JavaExecutable.png]]
 
[[File:JavaExecutable.png|File:JavaExecutable.png]]
  
  
== JVM Arguments ==
+
== JVM Arguments == <!--T:12-->
  
 +
<!--T:13-->
 
'''''Important: Make sure that you delete any existing arguments in the text box before you add the ones below. If you don't, then you will likely have duplicate values for the same parameters, and the game may use the wrong one.'''''
 
'''''Important: Make sure that you delete any existing arguments in the text box before you add the ones below. If you don't, then you will likely have duplicate values for the same parameters, and the game may use the wrong one.'''''
  
 +
<!--T:14-->
 
These arguments are edited by using the profile editor and putting text into the bottom box as well as marking the appropriate checkbox. The following string is a good starting point, but will very likely need to be edited at least partially to work properly with your computer. An explanation of what each part does and what you may need to change it to will be explained below:
 
These arguments are edited by using the profile editor and putting text into the bottom box as well as marking the appropriate checkbox. The following string is a good starting point, but will very likely need to be edited at least partially to work properly with your computer. An explanation of what each part does and what you may need to change it to will be explained below:
  
  -Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G -XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts
+
  <!--T:15-->
 +
-Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G -XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts
  
 +
<!--T:16-->
 
''Note: This string was chosen for use with Java 8. If you are using Java 7 there may be additional arguments that could help increase performance. More information about Java 7 VM arguments can be found [http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html here.]''
 
''Note: This string was chosen for use with Java 8. If you are using Java 7 there may be additional arguments that could help increase performance. More information about Java 7 VM arguments can be found [http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html here.]''
  
  
=== Memory Allocation ===
+
=== Memory Allocation === <!--T:17-->
  
  -Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G  
+
  <!--T:18-->
 +
-Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G  
  
 +
<!--T:19-->
 
TerraFirmaCraft requires a minimum of 1GB of memory to smoothly run single player without running into obvious issues. If you are using a 32-bit operating system, this is also essentially the maximum amount of memory you will be able to allocate as well. If you are using a 64-bit operating system, and are properly using a 64-bit version of java, you will be able to set your maximum higher. -Xms is used to set the minimum memory, and -Xmx is used to set the maximum memory allocation. -XX:NewSize and -XX:MaxNewSize should be set to 25% and 50% of -Xmx respectively.
 
TerraFirmaCraft requires a minimum of 1GB of memory to smoothly run single player without running into obvious issues. If you are using a 32-bit operating system, this is also essentially the maximum amount of memory you will be able to allocate as well. If you are using a 64-bit operating system, and are properly using a 64-bit version of java, you will be able to set your maximum higher. -Xms is used to set the minimum memory, and -Xmx is used to set the maximum memory allocation. -XX:NewSize and -XX:MaxNewSize should be set to 25% and 50% of -Xmx respectively.
  
 +
<!--T:20-->
 
For single player, or clients that are connecting to a server, a maximum of 2GB is recommended, but you are encouraged to adjust as necessary. The best way to see what will likely be a good maximum for you is to turn on the [http://minecraft.gamepedia.com/Debug_screen Minecraft Debug] overlay using F3. In the upper-right corner you'll see what percentage of memory is currently used. Generally speaking, you should aim for keeping that number below 75%, and ideally it should average around 50%. Allocating too much memory to Minecraft can surprisingly cause just as many issues with lag spikes as not allocating enough.
 
For single player, or clients that are connecting to a server, a maximum of 2GB is recommended, but you are encouraged to adjust as necessary. The best way to see what will likely be a good maximum for you is to turn on the [http://minecraft.gamepedia.com/Debug_screen Minecraft Debug] overlay using F3. In the upper-right corner you'll see what percentage of memory is currently used. Generally speaking, you should aim for keeping that number below 75%, and ideally it should average around 50%. Allocating too much memory to Minecraft can surprisingly cause just as many issues with lag spikes as not allocating enough.
  
  
==== 32-bit Systems ====
+
==== 32-bit Systems ==== <!--T:21-->
  
 +
<!--T:22-->
 
If you are using a 32-bit operating system, the most you can generally allocate is the following string:
 
If you are using a 32-bit operating system, the most you can generally allocate is the following string:
  
  -Xms1G -Xmx1G -XX:NewSize=256M -XX:MaxNewSize=512M  
+
  <!--T:23-->
 +
-Xms1G -Xmx1G -XX:NewSize=256M -XX:MaxNewSize=512M  
  
  
=== Garbage Collection ===
+
=== Garbage Collection === <!--T:24-->
  
  -XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts
+
  <!--T:25-->
 +
-XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts
  
 +
<!--T:26-->
 
One of the best ways to increase performance is to use JVM arguments to help with garbage collection. This will help prevent the large lag spikes and freezes that often occur while doing resource intensive things such as generating new terrain.
 
One of the best ways to increase performance is to use JVM arguments to help with garbage collection. This will help prevent the large lag spikes and freezes that often occur while doing resource intensive things such as generating new terrain.
  
 +
<!--T:27-->
 
*-XX:SurvivorRatio=2 : Ratio of eden/survivor space size
 
*-XX:SurvivorRatio=2 : Ratio of eden/survivor space size
 
*-XX:+DisableExplicitGC : Disables calls to System.gc()
 
*-XX:+DisableExplicitGC : Disables calls to System.gc()
Line 68: Line 89:
 
*-XX:+AggressiveOpts
 
*-XX:+AggressiveOpts
  
 +
<!--T:28-->
 
PermSize-related arguments and -XX:+CMSIncrementalPacing are intentionally not in this string, as they are deprecated in Java 8 and will be ignored.
 
PermSize-related arguments and -XX:+CMSIncrementalPacing are intentionally not in this string, as they are deprecated in Java 8 and will be ignored.
  
  
== Forge Version ==
+
== Forge Version == <!--T:29-->
  
 +
<!--T:30-->
 
You should always be using the version of [http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.7.10.html Forge] that TerraFirmaCraft was built on. If the current recommended version is newer than the version that TFC was built on, it ''should'' be safe to use that instead, but there is no guarantee.  
 
You should always be using the version of [http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.7.10.html Forge] that TerraFirmaCraft was built on. If the current recommended version is newer than the version that TFC was built on, it ''should'' be safe to use that instead, but there is no guarantee.  
  
  
== Install FastCraft ==
+
== Install FastCraft == <!--T:31-->
  
 +
<!--T:32-->
 
FastCraft is a mod created by the IC2 coder, Player, that is designed to help performance with Minecraft. This mod is optional, and can be installed on both clients and servers to help resolve some performance issues that are in vanilla Minecraft's code.
 
FastCraft is a mod created by the IC2 coder, Player, that is designed to help performance with Minecraft. This mod is optional, and can be installed on both clients and servers to help resolve some performance issues that are in vanilla Minecraft's code.
  
 +
<!--T:33-->
 
FastCraft is located [https://www.curseforge.com/minecraft/mc-mods/fastcraft here].
 
FastCraft is located [https://www.curseforge.com/minecraft/mc-mods/fastcraft here].
  
  
== Install/Uninstall Optifine ==
+
== Install/Uninstall Optifine == <!--T:34-->
  
 +
<!--T:35-->
 
As counter-intuitive as it may sound, Optifine has been known in the past to cause more lag than it fixes when it comes to modded Minecraft. Your results may vary, but we still encourage that you try playing both with and without Optifine to see for yourself which way gets better performance on your system. Optifine may also cause graphical glitches such as floating trees and missing water; use at your own risk.
 
As counter-intuitive as it may sound, Optifine has been known in the past to cause more lag than it fixes when it comes to modded Minecraft. Your results may vary, but we still encourage that you try playing both with and without Optifine to see for yourself which way gets better performance on your system. Optifine may also cause graphical glitches such as floating trees and missing water; use at your own risk.
  
 +
<!--T:36-->
 
The official Optifine website can be found [http://optifine.net/downloads here].
 
The official Optifine website can be found [http://optifine.net/downloads here].
  
  
== Smooth Lighting ==
+
== Smooth Lighting == <!--T:37-->
  
 +
<!--T:38-->
 
Turning off Smooth Lighting -especially in areas with a lot of trees or roofs -may increase your FPS.
 
Turning off Smooth Lighting -especially in areas with a lot of trees or roofs -may increase your FPS.
  
Line 100: Line 128:
 
{{Blocks}}
 
{{Blocks}}
 
<translate>
 
<translate>
 +
<!--T:39-->
 
[[Category:Guides]]
 
[[Category:Guides]]
 
</translate>
 
</translate>

Revision as of 19:34, 17 March 2021

Other languages:
English • ‎русский

Overview

Minecraft 1.7.10 is known to have some performance issues compared to other versions, and this is made even worse by the fact that TerraFirmaCraft utilizes the full 256 world height. Your system may be able to play other heavily modded instances of Minecraft with no issues, but when it comes to TerraFirmaCraft it's like comparing apples to oranges. In vanilla Minecraft, as well as 99.9% of all modded Minecraft, the sea-level of the overworld is at y=63. In TFC, sea-level is all the way up at about y=140. That means that in every chunk (which is an area of 16x16 blocks), there are about 20,000 more blocks to load. There are also a handful of other things that make TFC much more resource intensive, so this page is a guide to help make the game run as smoothly as possible. It is strongly recommended that you go through all of the following categories, as they are generally equally important in improving performance.


Java Version

First and foremost, you should check which version of Java that Minecraft is running. You can do this on the vanilla launcher by clicking on the tab that says Launcher Log. If you are using a newer copy of the vanilla launcher, it will likely have come bundled with the correct version of java for your system, but it is still a good idea to check.

Clicking on the tab will show a log that looks like this:

File:LauncherLog.png

On this log there are three values that you should look for:

  • os.arch - If you are using a 32-bit or 64-bit operating system.
  • java.version - The version of java you are currently using. You should be using Java 8, which is shown with the 1.8.#.
  • sun.arch.data.model - If you are using the 32-bit or 64-bit java. You should be using a version that matches your operating system.

The latest version of Java can be found here. Make sure you install the correct one for your operating system, and that you uninstall any older versions of Java your system may be running. x86 is for 32-bit systems, and x64 is for 64-bit systems. Note: If you are using a Mac, you may need to keep Java 6 installed. If in the program listing, it does not explicitly say 64-bit in the name, it is the 32-bit version.

Important: Generally speaking, any updates to java that are automatically installed will be the 32-bit version. Each time you update it is crucial that you make sure it installed the correct version.

If you needed to download and install a new version of java, click on Edit Profile on the launcher to make sure that it is going to use this new version. You'll need to point it to where java was installed:

File:JavaExecutable.png


JVM Arguments

Important: Make sure that you delete any existing arguments in the text box before you add the ones below. If you don't, then you will likely have duplicate values for the same parameters, and the game may use the wrong one.

These arguments are edited by using the profile editor and putting text into the bottom box as well as marking the appropriate checkbox. The following string is a good starting point, but will very likely need to be edited at least partially to work properly with your computer. An explanation of what each part does and what you may need to change it to will be explained below:

-Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G -XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts

Note: This string was chosen for use with Java 8. If you are using Java 7 there may be additional arguments that could help increase performance. More information about Java 7 VM arguments can be found here.


Memory Allocation

-Xms1G -Xmx2G -XX:NewSize=512M -XX:MaxNewSize=1G 

TerraFirmaCraft requires a minimum of 1GB of memory to smoothly run single player without running into obvious issues. If you are using a 32-bit operating system, this is also essentially the maximum amount of memory you will be able to allocate as well. If you are using a 64-bit operating system, and are properly using a 64-bit version of java, you will be able to set your maximum higher. -Xms is used to set the minimum memory, and -Xmx is used to set the maximum memory allocation. -XX:NewSize and -XX:MaxNewSize should be set to 25% and 50% of -Xmx respectively.

For single player, or clients that are connecting to a server, a maximum of 2GB is recommended, but you are encouraged to adjust as necessary. The best way to see what will likely be a good maximum for you is to turn on the Minecraft Debug overlay using F3. In the upper-right corner you'll see what percentage of memory is currently used. Generally speaking, you should aim for keeping that number below 75%, and ideally it should average around 50%. Allocating too much memory to Minecraft can surprisingly cause just as many issues with lag spikes as not allocating enough.


32-bit Systems

If you are using a 32-bit operating system, the most you can generally allocate is the following string:

-Xms1G -Xmx1G -XX:NewSize=256M -XX:MaxNewSize=512M 


Garbage Collection

-XX:SurvivorRatio=2 -XX:+DisableExplicitGC -d64 -XX:+UseConcMarkSweepGC -XX:+AggressiveOpts

One of the best ways to increase performance is to use JVM arguments to help with garbage collection. This will help prevent the large lag spikes and freezes that often occur while doing resource intensive things such as generating new terrain.

  • -XX:SurvivorRatio=2 : Ratio of eden/survivor space size
  • -XX:+DisableExplicitGC : Disables calls to System.gc()
  • -d64 : Forces java to use the 64-bit version in case you have a lingering installation of 32-bit. Do not use this argument if you are on a 32-bit operating system.
  • -XX:+UseConcMarkSweepGC : Use concurrent mark-sweep collection for the old generation.
  • -XX:+AggressiveOpts

PermSize-related arguments and -XX:+CMSIncrementalPacing are intentionally not in this string, as they are deprecated in Java 8 and will be ignored.


Forge Version

You should always be using the version of Forge that TerraFirmaCraft was built on. If the current recommended version is newer than the version that TFC was built on, it should be safe to use that instead, but there is no guarantee.


Install FastCraft

FastCraft is a mod created by the IC2 coder, Player, that is designed to help performance with Minecraft. This mod is optional, and can be installed on both clients and servers to help resolve some performance issues that are in vanilla Minecraft's code.

FastCraft is located here.


Install/Uninstall Optifine

As counter-intuitive as it may sound, Optifine has been known in the past to cause more lag than it fixes when it comes to modded Minecraft. Your results may vary, but we still encourage that you try playing both with and without Optifine to see for yourself which way gets better performance on your system. Optifine may also cause graphical glitches such as floating trees and missing water; use at your own risk.

The official Optifine website can be found here.


Smooth Lighting

Turning off Smooth Lighting -especially in areas with a lot of trees or roofs -may increase your FPS.