Оптимизация производительности

From TerraFirmaCraft Plus Wiki
Jump to: navigation, search
This page is a translated version of the page Performance Optimization and the translation is 35% complete.

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

Общие сведения

В сравнении с другими версиями 1.7.10 оптимизирован несколько хуже, и это усугубляется тем, что TFC+ использует высоту мира в 256 блоков. Ваш компьютер может справляться с большим количеством модов, но сравнивать обычные моды и TerraFirmaCraft - сравнивать землю и небо. В обычном майнкрафте море находится на y=63. В TFC же уровень моря - где-то y=140. Это означает, что один чанк (область 16 на 16 блоков) на целых 20 000 блоков больше. Есть ещё несколько вещей, делающих TFC ресурсоёмким модом, так что эта страница - гайд по улучшению производительности на столько, на сколько это возможно. Настоятельно рекомендуется попробовать все ниже описанные категории, так как они все одинаково важны при улучшении производительности.


Версия Java

В первую очередь проверьте версию Java, которую использует майнкрафт. В обычном лаунчере это делается во вкладке Лог лаунчера. Если вы используете копию лаунчера новей, она скорее всего уже имеет при себе правильную для вашей системы версию Java, но всё же проверить стоит.

Клик по вкладке покажет лог, выглядящий вот так:

File:LauncherLog.png

В этом логе вам нужно найти три значения:

  • os.arch - 32 или 64 бита использует ваша система.
  • java.version - версия используемой Java. Вы должны пользоваться Java 8, то есть версиями, начинающимися с 1.8.#.
  • sun.arch.data.model - 32-х или 64-х битную Java вы используете. Битность Java и вашей системы должны совпадать.

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.

Важно:Вообще, все автоматические обновления Java - 32-х битные. Каждый раз, когда Вы обновляете необходимо убедиться, что вы установили корректную версию.

Если вам понадобится скачать и установить новую версию Явы, кликните на "Редактировать профиль" в лаунчере чтоб убедиться, что он будет использовать эту новую версию. Вам нужно будет указать на расположение Java:

File:JavaExecutable.png


Аргументы JVM

Важно: Убедитесь в том, что вы удалили любые существующие аргументы перед добавлением ниже написанных. В противном случае у вас будут дубликаты, и игра может использовать не тот аргумент.

Эти аргументы были отредактированы редактором профилей и вставкой текста, так же как и пометкой соответствующих флажков. Следующие аргументы - хорошее начало

-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.