The Performance Thread

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
Hi all,

First an introduction and explanation for this thread. As my (mostly tech based) base gets bigger and more complicated my performance gets lower. Of course this is to be expected. More machines means more things to render and more things to compute. However, with modded MineCraft there are so many differnt ways to accomplish things that I'm starting to think about how to optimize my base. That's what this thread is for. I'm trying to collect information from both my own experiences as well as knowledge that is present in the community but is scattered all over the place. Many of the things in this thread are probably known to many people but I'm hoping that at least I and hopefully also others can learn a lot from this thread. To make things a bit more structured I'm going to use different sections.

So one thing to remember: I'm learning all of this myself so it is possible (and even likely) that this message contains many errors or wrong bits of information. Some information here I haven't personally tested or measured and was collected from the internet.

Additionally as I'm currently playing mostly SSP that's where most of my knowledge comes from but I'll try to add server related information too when I know about it.

The information in this thread is also mostly for 1.6.4 as that's the version I'm currently playing. Many things here might also be useful for 1.7.2 but I haven't tried that version yet.

Also I used Opis to find out some interesting things. I don't know if there are other tools that can be useful for investigating performance issues?


General Performance Hints

There are several things to do about performance in general. In this section I'll go over a few possibilities:

  • Computer hardware. Obviously more memory is better. It seems to me that 8Gig is a minimum to get MineCraft running with a big number of mods (i.e. around 160) and a good video card (nvidia for example) is wanted.
  • Java and java flags. It is of course to be expected that using 64-bit java is best (and sometimes required). At this moment it is also recommended to use Java 7 as (hopefully) it gives more performance and also some mods require it. As to the actual flags to use. This is a bit more complicated. Googling on this subject gives many (sometimes conflicting) results. Some people say to simply use the flags to give Java more memory but keep it at that. Others use a really complicated collection of flags. This seems to be a more complicated subject and I'm not sure here what advice to give to others. On windows my son is currently using this:-Xmx4G -Xms1736M -XX:+UseConcMarkSweepGC -server -XX:+UseParNewGC -XX:+AggressiveOpts -XX:TargetSurvivorRatio=90 -XX:+UseFastAccessorMethods -XX:+UseBiasedLocking -XX:+UseAdaptiveGCBoundary -XX: ParallelGCThreads=4 -XX: PermSize=150M -XX:MaxPermSize=256M -XX:+OptimizeStringConcatHowever, these flags caused MineCraft not to start up on my Linux computer so I had to remove several. As I'm not at my linux computer right now I don't remember what they were.
  • Resource pack. Obviously going with higher resolution textures can cause a noticable decrease in performance. I'm currently using Faithful 32x32 and I already noticed that when I switch back to default 16x16 I go from about 33 fps to 36 fps. I'm considering making my own subset of Faithful containing only the 32x32 textures for objects where I consider 16x16 too ugly to look at.
  • MineCraft graphical options. MineCraft itself has various options that you can play with. For example, disabling particles will increase performance. I generally prefer to keep particles on as I like them and without particles you can sometimes miss important information. There are other options here but I don't know in general what is best in that respect. So hints here are welcome.
  • Optimization mods. I know of only two optimization mods right now. One is EVOC from Professor Mobius which tries to optimize a few tile entities in MineCraft. I believe it currently only handles hoppers, monster spawners, and the furnace. The other very well known mod is OptiFine. The opinions on OptiFine are divided. I liked to use it a lot since I really love the great viewing distance it gives me. But at some point I had to stop using it because too many mods don't properly work with OptiFine and give rendering glitches. Very unfortunate but that's what it is.
  • For single player a good advice might also be to use multiple dimensions or far away places to avoid cramming all machines in a single spot. So for example, you could have an ore processing center chunk loaded very far from your main base to avoid rendering performance overhead. The ore processing machines would still have to be chunkloaded so you will get all the server side overhead but not the client side overhead. On a server with multiple players you obviously have to be more careful with this advice as every extra loaded chunk causes more work for the server. Also multiple dimensions also cause more overhead on a server.

Mods in General

Some mods are known to cause more lag in general then others. However, I would want to add some warning to this statement. In the community some mods have the reputation of being slow. For example, I've seen people say that Ars Magica is slow, also RotaryCraft sometimes gets accused of being slow. On the other hand I've seen others who dispute those statements and have a full base with nothing but Ars Magica and/or RotaryCraft and experience no problem whatsoever. So I think it is a bit too easy to state that a certain mod is slow and that the real answer is that it usually depends on a lot of factors. In case of Ars Magica for example it seems to be that due to a bug sometimes a lot of Hecates spawn in the world. I have not experienced this myself so I don't know what's up with that. With RotaryCraft I've seen people complain that it is heavy on the graphical side. This is possible since RotaryCraft has models that have a lot of polygons. However on my world I found that when I benchmarked with Opis, it is not on the client side that RotaryCraft causes some slowdowns but instead on the server side. So just saying that it is dangerous to just declare a mod as being slow. It depends on too many other things (and possibly even combinations of mods).

I'm still learning how to interprete Opis but in my world I discovered that Thaumcraft has 660 glimmer of light entities. This seems like a lot so this might be something I would like to look at. Perhaps by removing the arcane lamps I added and replacing them with a magnum torch for similar safety.

Also with Opis I found the surprising results that JABBA barrels take up a *lot* of render time. So I removed all of them and replaced them with the MFR Unifier.

Ender chests (from EnderStorage mod) were also high in the list on the client side.


Mod specific advice

In this section I would like to add advice specific to certain mods. This is a section where I would really like to see more information. All mods have config files where you can tweak stuff. I already found several config files that you can edit to get slightly more performance and I'd like to learn more here. In addition there are things to do, and not to do with most mods. So here is a list of what I know so far:

  • Magical Crops: in magicalcrops.cfg you can disable the particles on crops with:
    I:"Enable or disable particle effects on crops, 1 = Enabled (Default), 0 = Disabled"=0
  • BigReactors: according to the wiki (but haven't tried this myself) making a turbine without glass should make sure the animation for the turbine isn't rendered which would presumably speed up things.
  • RotaryCraft: I've read that disabling the block damage from machines would improve performance because it wouldn't have to check that much. I tried this on my world and I believe that it actually did increase the performance of my big solar tower that I made with RotaryCraft:
    B:"Block Damage from Destructive Machines"=false
    If you want to make sure that the mob spawner from RoC doesn't spam your world with too many mobs you can lower that with:
    I:"Spawner Mob Limit"=128
  • Applied Energistics: the flashing of the ME cables can presumably cause some lag. There are two ways to avoid this. The first is to use the covered cables instead of the normal ones but that doesn't fully avoid the problem as the flashes can still be seen in corners and also in import and export busses. The second way is to disable this animation completely in the config:B:gfxCableAnimation=falseThe monitors (while extremely cool) are relatively expensive to render. At least according to Opis. So only use them when really needed.
  • Thermal Expansion: avoid transparent itemducts. They do look cool (and I do use them in some places where I like to see the items flowing through) but obviously are somewhat heavier on performance. Also make sure you ducts are not too fast. I actually had a problem in some space where my RoC boring machines were feeding items to a single unifier through itemducts. But the MFR Unifier is not very fast and the result was that the items were bouncing back from the Unifier through the itemducts. Because I was using transparent itemducts I was able to see that. In this particular case I solved this issue by using round robin on the itemduct and feeding it to multiple unifiers.
  • EnderIO: I like to use EnderIO a lot because it has very compact cables where you can place four different types of cables in a single block. This makes for very compact designs. But I have a question about this mod. It doesn't (currently) support Forge Multi Part but it uses its own system with Conduit Facades to hide blocks. In principle (from a programmer's perspective) I would expect this to be more optimal. Because conduit facades are full blocks they are (hopefully) very easy to render as it wouldn't cost more resources to render as a normal MineCraft block. With Forge Multi Part this can't be done because in general with FMP you make a model that has more polygons. The conduits hidden by FMP can still be observed from certain sides so the render engine can't simply decide not to render them. So my hope is that EnderIO with Conduit Facades is more optimal because the cables inside such a facade don't have to be rendered at all. But I haven't found any conclusive information about this to confirm that this is indeed the case or not.
  • Forestry: I have read that forestry trees that are still growing their fruit can cause considerable lag until the fruit is full grown. Not 100% sure on this though.
  • Forge Multi Part: I'm not 100% sure but I would expect a lot of FMP usage to decrease performance since you are in essence adding more polygons to be rendered. You also have to be aware that placing in cover in front of a cable doesn't prevent that cable from being rendered since the cover never completely hides it and even if it did there is no easy way for the computer to know that the cable is hidden by the cover. So covers don't help to improve performance.
  • BiblioCraft: the tool rack came up high in the opis profiling results for rendering.
  • Logistics Pipes: I have little information about this mod except that I can only imagine that performance may go down if you have a lot of stuff going on with your pipes. Anyone has more information about performance with regards to LP?

Mechanism specific advice

In this section I talk about multiple ways to accomplish the same thing with performance in mind. A few things were already mentioned in the previous section though.

  • Transmitting RF power:
    • The most obvious way to transmit RF power is to use cables or conduits. There are various mods that have ways for this (like TE, MFR, EnderIO, ...). I'm thinking/hoping that EnderIO is one of the most optimal ways. Especially when the RF conduits are hidden in Conduit Facades (see the section on EnderIO above) but I'm not sure of that.
    • Another (more expensive) way to transmit power is of course the Tesseract. This is probably the best way to transmit power if you can afford the cost of creating many tesseracts (or if you play creative).
  • Transmitting items: again there are multiple ways to handle this.
    • Pipes: In general it is best to use pipes that are not transparent. With EnderIO you can combine an item pipe with other pipes in the same block.
    • A Tesseract can also do items. Presumably in an efficient way.
    • An ender chest can also be used to transmit items but I think that should only be done for long distances and if a tesseract is too expensive as I believe ender chests are less optimal (they come up high in my opis benchmark)
    • Other ways?
  • Transmitting fluids:
    • Pipes: I'm curious to know what mods have the most efficient pipes. I'm using EnderIO for most of my fluid transmition (for the reasons already explained above).
    • A tesseract can also do fluids.
    • There are also ender tanks from the EnderStorage mod but I have also heared that they are not very good for framerate. Can someone confirm this?
  • Basic redstone:
    • You can use normal redstone (Vanilla). I'm not 100% sure but since that animates (particles) I would expect that to be slightly bad for performance.
    • Several mods like Project Red, Red Logic, Mekanism and MFR have cables for transmitting redstone. I don't know if there are difference in performace between these various ways?
    • There is also wireless redstone from ChickenBones but that should probably only be used for longer distances.
  • Tanks:
    • Many mods add tanks. I already heared that OpenBlocks tanks are not very performant and that TE portable tanks are good. What about drums and tanks from other mods?

This document is far from finished. There is probably a lot more advice and things to learn from the community. I'd like to hear about this from you. Thanks!
 
Last edited:

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
I know there haven't been any replies to this but nevertheless I added a paragraph about fluid tanks.
 

ljfa

New Member
Jul 29, 2019
2,761
-46
0
Drums don't show their filling level, only the color of the fluid, but they seem to have many polygons: When I type "drum" in NEI a whole bunch of drums are displayed which cause my FPS to drop.

I noticed a severe FPS drop with Mariculture fluid tanks: I had lava pumped in from one side and pumped out from another. It may be because the filling level was fluctuating between 16000 and like 15990 all the time.
 

epidemia78

New Member
Jul 29, 2019
1,810
-4
0
The best way to avoid lag is to spread things out so your machines, pipes and tubes arent all clustered together. The java argument I use goes as follows:
Code:
-Xms3G -Xmx3G -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled

It makes a huge impact, I cant even generate a world without it.
 

epidemia78

New Member
Jul 29, 2019
1,810
-4
0
Well one of the best ways to avoid lag is to not build too much stuff in one chunk. The java argument I use goes as follows:
Code:
-Xms3G -Xmx3G -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled
. I cant even generate a new world without it.

While testing traincraft in creative I noticed some huge lag which I assumed was the trains. But it was actually the nearby Ars Magica witchwood forest. Even though I had disabled the falling leaf animation, I will disable the biome entirely next time. Oh and that reminds me. According to the Highlands author, the three mountain biomes (rock, desert and snow) is bugged and needs to be disabled. I know this is true from experience. They arent disabled in the monster config though.
 

ThatOneSlowking

New Member
Jul 29, 2019
3,520
0
0
I read part of it.
8 gig minimum? That just sounds stupid.
4 gigs MAXIMUM
2.5 gigs MINIMUM
Unless it is a server, 8 gigs is a waste. It actually makes preformance worse.
 
  • Like
Reactions: shockwave95

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
I read part of it.
8 gig minimum? That just sounds stupid.
4 gigs MAXIMUM
2.5 gigs MINIMUM
Unless it is a server, 8 gigs is a waste. It actually makes preformance worse.

I was not talking about the memory allocated for MineCraft but the memory available in your computer. I have three computers here and on the computer with only 4 Gig it is hard to get MineCraft to run well with a lot of mods.
 
  • Like
Reactions: ThatOneSlowking

ThatOneSlowking

New Member
Jul 29, 2019
3,520
0
0
I was not talking about the memory allocated for MineCraft but the memory available in your computer. I have three computers here and on the computer with only 4 Gig it is hard to get MineCraft to run well with a lot of mods.
Ah. That makes MUCH more sense xD
 
  • Like
Reactions: shockwave95

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
I have another question. I suddenly notice when looking at my configs that some time ago (I forgot about it) I modifed ForgeChunkLoading.cfg like this:

14c14
< I:maximumChunksPerTicket=50

---
> I:maximumChunksPerTicket=25

17c17
< I:maximumTicketCount=300

---
> I:maximumTicketCount=200

i.e. I basically lowered maximumChunksPerTicket and maximumTicketCount. That was done to try to solve the huge extreme lag issue I was experiencing from time to time (espcecially in Twilight Forest). But I don't think it really helps. Can someone explain to me what these actually do and if changing them like I did is a good idea?


Also another question. I always thought OptiFine wasn't good with many mods and in fact when I had it in the past I indeed did have some compatibility issues. However I'm watching sl1pg8ter's channel and in the FTB Monster lets play he recently switched to using optifine to solve lag problems he was having and he seems to have no issues at all. So I'm a bit wondering about this. Is optifine better these days or does it matter on how optifine is configured?
 
Last edited:

ThatOneSlowking

New Member
Jul 29, 2019
3,520
0
0
I have another question. I suddenly notice when looking at my configs that some time ago (I forgot about it) I modifed ForgeChunkLoading.cfg like this:



i.e. I basically lowered maximumChunksPerTicket and maximumTicketCount. That was done to try to solve the huge extreme lag issue I was experiencing from time to time (espcecially in Twilight Forest). But I don't think it really helps. Can someone explain to me what these actually do and if changing them like I did is a good idea?


Also another question. I always thought OptiFine wasn't good with many mods and in fact when I had it in the past I indeed did have some compatibility issues. However I'm watching sl1pg8ter's channel and in the FTB Monster lets play he recently switched to using optifine to solve lag problems he was having and he seems to have no issues at all. So I'm a bit wondering about this. Is optifine better these days or does it matter on how optifine is configured?
Optifine has a new version that has fixed most,of the major issues, but still has some problems. Optifine is 100% fixed in 1.7. It also depends on your system, sometimes OF is helpful, on others it slows the game down.
 

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
Optifine has a new version that has fixed most,of the major issues, but still has some problems. Optifine is 100% fixed in 1.7. It also depends on your system, sometimes OF is helpful, on others it slows the game down.

Thanks. I'll try it out. I'm assuming the latest version is OptiFine_1.6.4_HD_D1.jar? At least that's the latest I can find but it is already several months old.
 

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
Ok, optifine seems to work somewhat better now. I still get Z-fighting issues on thermal expansion blocks though. i.e. the colored squares on some of the machines are flickering when I move. Is there a configuration option I can use to fix that?
 

Xarlas

New Member
Jul 29, 2019
53
0
0
Could you Guys Post your Java Parameters please :)
Because mine crash my Monster setup (works without them)
 
  • Like
Reactions: McJty

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
That's a good idea. I will post mine when I get back home. I really would like to learn more about how to select the best flags for MineCraft as there is a lot of conflicting information on the internet.
 

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
The flags I'm using right now are:

-Xmx3G -Xms1500M -XX:+UseConcMarkSweepGC -server -XX:+UseParNewGC -XX: PermSize=256M -XX:MaxPermSize=256M -XX:+OptimizeStringConcat -XX:+CMSClassUnloadingEnabled

I have really no clue about many of these and I'm not sure if these are really needed or sufficient.
 

Feniks

New Member
Jul 29, 2019
356
0
0
Can someone explain flags to non-it person? What are they where do you change them are they computer specific or can I copy one of yours and should be fine?
 

McJty

Over-Achiever
Mod Developer
May 13, 2014
2,015
2,519
228
twitter.com
In my quest to solve a 'garbage collection freeze problem' that I'm having I'm studying the garbage collection flags. Here is what I found so far:

  • UseConcMarkSweepGC: the concurrent collector, a garbage collection algorithm that attempts to do most of the garbage collection work in the background without stopping application threads while it works (there are still phases where it has to stop application threads, but these phases are attempted to be kept to a minimum). Note if the concurrent collector fails to keep up with the garbage, it fails over to the serial MarkSweepCompact collector for (just) the next GC.
  • UseParNewGC: the parallel copy collector, like the Copy collector, but uses multiple threads in parallel and has an internal 'callback' that allows an old generation collector to operate on the objects it collects (really written to work with the concurrent collector).
  • DisableExplicitGC: Make sure java code can’t ask for an explicit GC
  • UseAdaptiveGCBoundary:
  • UseParallelGC: the parallel scavenge collector, like the Copy collector, but uses multiple threads in parallel and has some knowledge of how the old generation is collected (essentially written to work with the serial and PS old gen collectors).
  • MaxGCPauseMillis: not sure
  • ParallelGCThreads: number of parallel threads that can be used for the garbage collector. Recommended to set to the number of cores you have

Please feel free to correct/adjust me
 

UniZero

Popular Member
Oct 3, 2012
3,406
310
124
Scotland, UK
I was using the java parameters from Eyamaz in this thread below. But I have since stopped using them because when going through portals or using mystcraft books I would get a memory connection error and a delay in going through said portal or book. But after taking them out it does not do this now. I assume it is one or more of the flags causing the problem.
 

kittle

New Member
Jul 29, 2019
229
0
0
One thing you missed on the PC Specs is your CPU speed and number of cores
Anything beyond 4 cores wont really help.
Your CPU should be a MIN of 2.5 ghz (yes I know some get by with less). 3.0ghz or higher is recommended.

Other stuff:
Make sure your PC is not running in power saving mode (this usually throttles back the CPU speed)

Make sure your graphics driver is set to use 3d acceleration for java.exe (The processfor nvida and ATI are different. do a forum search to find the steps)