Performance
Project Red Auto Crafting Benches cache their recipes
Project Red Auto Crafting Benches remember the recipe of each plan instead of searching the whole crafting recipe list again on every plan switch and every inventory change. They also count their stored ingredients once per craft rather than once per ingredient, so a row of benches costs the server less tick time.
Shipped in: ProjectRed #69
Leaving a world frees its memory
Quitting a world to the menu or changing dimension no longer leaves the old world in memory. Many mods kept a reference to the last world they saw, so loading a second singleplayer world kept the first one's integrated server in RAM as well. GregTech, AE2, Angelica, EnderIO, Forestry, BetterQuesting and OpenComputers are among the mods fixed, and Hodgepodge patches the same fault in Forge, vanilla Minecraft, IC2 and BiblioCraft.
Two leaks grew without limit and are gone. With Draconic Evolution Dislocator Inhibitors in the world, every dimension change kept another copy of the world until the game ran out of memory. Wearing the Twilight Forest Ur-Ghast trophy built a new model every frame until the game froze.
Shipped in 96 pull requests
- fix world leak caused by SBRWorldContext (GT5-Unofficial #6523)
- fix world leak caused by MobHandlerLoader$MobEECRecipe#entityCopy (GT5-Unofficial #6427)
- fix two world server memory leaks caused by pollution and chunk manager (GT5-Unofficial #6296)
- fix world client leak in CTMUtils (Angelica #1724)
- [Memory-opti:fix leak] fix world client leak caused by lambda in IrisExclusiveUniforms$WorldInfoUniforms (Angelica #1701)
- [Memory-opti:fix leak] Fix dynamic lights world client leaks (Angelica #1700)
- Fix cached item in RenderItemFrame leaking both world client and server (Angelica #1659)
- fix two world client memory leaks (Angelica #1650)
- Fix leaks in TickHandler (Applied-Energistics-2-Unofficial #1291)
- [Memory-opti:fix leak] Delete cache in waila plugin to avoid memory leak (Applied-Energistics-2-Unofficial #1264)
- [Memory-opti:fix leak] fix world client leak in MEGuiTextField (Applied-Energistics-2-Unofficial #1252)
- [Memory-opti:fix leak] Fix memory leak from AEBaseGui item renderer (Applied-Energistics-2-Unofficial #1248)
- fix World Leak in GuiMEMonitorable (Applied-Energistics-2-Unofficial #1222)
- Fix memory leak caused by ThreadLocal<RenderBlocksWorkaround> (Applied-Energistics-2-Unofficial #1215)
- fix two world client memory leaks (Applied-Energistics-2-Unofficial #1183)
- [Memory-opti:fix leak] Fix world leak in CraftingCPUCluster and AppEngRenderItem (Applied-Energistics-2-Unofficial #956)
- [Memory-opti:fix leak] fix memory leak in IC2 OverlayTESR (Hodgepodge #872)
- [Memory-opti:fix leak] fix forge's FakePlayerFactory leaking the world server (Hodgepodge #867)
- fix world leak in TeleporterThaumcraft caused by LongHashMap transformer (Hodgepodge #863)
- Fix 16 world client leaks in bibliocraft's TESR (Hodgepodge #853)
- Change certain client memory leak fix to run on each dimension swap (Hodgepodge #843)
- Fix RenderFallingBlock leaking world instance (Hodgepodge #842)
- fix ic2 block reactor world leak (Hodgepodge #841)
- fix RenderBlocks static instance leaking world (Hodgepodge #831)
- Fix all remaining WorldClient leaks (Hodgepodge #823)
- fix ChunkGenScheduler memory leak (Hodgepodge #816)
- Fix World MapStorage memory leak (Hodgepodge #815)
- Fix memory leak caused by CommandBase#theAdmin (Hodgepodge #813)
- Fix memory leak caused by FML network channels attributes (Hodgepodge #812)
- Fix leaking the last rendered item when unloading a world (Hodgepodge #804)
- fix CoFH world leak in main mod class (Hodgepodge #695)
- [Memory-opti:fix leak] Fix world leak in MinecraftServer by clearing the static server instance (Hodgepodge #675)
- [Memory-opti:fix leak] Fix world leak in SPacketMEUpdateBuffer (AE2FluidCraft-Rework #374)
- [Memory-opti:fix leak] Fix world leak in GuiHelper#BLANK_GUI (ServerUtilities #251)
- Fix 4 world client leaks (EnderIO #235)
- Fix world client leak in TechneMachineRenderer (EnderIO #233)
- [Memory-opti:fix leak] Fix World leak in WirelessChargerController (EnderIO #212)
- [Memory-opti:fix leak] Fix World leak in ConduitNetworkTickHandler (EnderIO #211)
- fix client leaks (BetterQuesting #206)
- Fix server leak (BetterQuesting #196)
- [Memory-opti:fix leak] fix two world leaks (OpenComputers #189)
- fix server leak caused by StaticSimpleEnvironment (OpenComputers #186)
- [Memory-opti:fix leak] Fix 4 world leaks (InventoryBogoSorter #182)
- [Memory-opti:fix leak] Fix world leak in PlayerContainerListener (BetterQuesting #179)
- fix three world leaks in TESR (Botania #136)
- fix world server memory leak (twilightforest #136)
- Fix world client leak in ItemRendererFlag (Galacticraft #133)
- fix net handler leak (BloodMagic #130)
- Fix world server leak (Galacticraft #129)
- [Memory-opti:fix leak] fix leak in net handler by just copying fml code as the TODO suggests (LogisticsPipes #122)
- Fix world client leaks in butterfly and analyzer renderer (ForestryMC #116)
- Fix WorldClient memory leak (ForestryMC #113)
- [Memory-opti:fix leak] Fix world leak in ServerPacketBufferHandlerThread (LogisticsPipes #111)
- Fix two world leaks (ThaumicHorizons #110)
- [Memory-opti:fix leak] Fix world leak in TileAnchorWorld (Railcraft #104)
- Properly use client / common proxies to fix memory leaks (Draconic-Evolution #97)
- fix world client leak caused by static CraftGUI (Binnie #95)
- Fix memory leak in ModularUIContext (ModularUI #94)
- Fix memory leak (ThaumicTinkerer #91)
- fix world client leak in RendererMachine (Binnie #90)
- Fix world client memory leaks caused by block renderers (Chisel #88)
- [Memory-opti:fix leak] fix world client leak caused by light matrix (ProjectRed #81)
- Fix server memory leak (VendingMachine #77)
- fix world server memory leak caused by reusableRun object pools (ProjectRed #76)
- [Memory-opti:fix leak] fix client leak from DataAccessorFMP (waila #65)
- [Memory-opti:fix leak] Fix two world leaks (Et-Futurum-Requiem #63)
- Fix 4 World memory leaks and delete one unused file (LittleTiles #58)
- Fix two world server leaks (Gadomancy #55)
- fix world client memory leak in GuiMultiblockHandler (BlockRenderer6343 #48)
- Fix two world client leaks in renderers (OpenBlocks #47)
- [Memory-opti:fix leak] fix world client leak in renderer (ForgeMultipart #44)
- [Memory-opti:fix leak] Fix world leak in Event class (Gadomancy #44)
- fix world client leak (HydroEnergy #44)
- [Memory-opti:fix leak] fix world client from keybind handler (ForgeMultipart #43)
- fix world server leak (ForgeMultipart #41)
- fix world server memory leak in Tree Generators (Natura #41)
- fix client world leak in RenderTileEssenceAltar (Hardcore-Ender-Expansion #38)
- fix memory leak caused by PowerSources (WitcheryExtras #38)
- fix world client leak in PreviewRenderer (ArchitectureCraft #36)
- fix world client leak in CustomCubeRenderer (EnderCore #34)
- [Memory-opti:fix leak] Fix memory leak from PlayerHandler (Baubles-Expanded #33)
- [Memory-opti:fix leak] fix three world leaks (BuildCraft #32)
- fix world server leak caused by EventWorldTick (Nutrition #32)
- Fix 10 world client leaks in renderers (MalisisDoors #28)
- Fix commands leaking server (CraftTweaker #27)
- Fix world client leak (Infernal-Mobs #23)
- Fix two world leaks (Amazing-Trophies #20)
- Fix WorldServer memory leak (Random-Things #18)
- fix world client leak from light matrix (MrTJPCore #16)
- Do some cleanup + fix world client leak (WirelessRedstone-CBE #14)
- [Memory-opti:fix leak] fix light matrix world leak (ForgeRelocation #12)
- Do some cleanup / fix world client leak (CosmeticArmorReworked #2)
- Fix memory leak in ImageBufferDownloadPlayerSkin (SimpleSkinBackport #1)
- Fix world memory leak caused by ItemStack mixin (InventoryBogoSorter #228)
- Fix ur-ghast armor renderer spamming allocations (twilightforest #137)
- Import EnchantmentHelper memory leak fix from ArchaicFix (Hodgepodge #839)
Fewer allocations during play
More than twenty mods, among them GregTech, AE2, EnderIO, Forestry, Galacticraft and Logistics Pipes, no longer build a fresh array every time they look up one of their fixed lists of machine types, colours or ore kinds; each list is built once and reused. Several renderers stopped creating objects for every frame they draw. GregTech's item renderer no longer makes a lookup key per item drawn, and Draconic Evolution's Dissenchanter, Energy Infuser, Teleporter Stand, Upgrade Modifier and placed items reuse one item entity instead of spawning a new one each frame.
Shipped in 32 pull requests
- use long packing to avoid allocating object wrappers in the render loop in MetaGeneratedItemRenderer (GT5-Unofficial #6066)
- cache OutputBusType#values() (GT5-Unofficial #6047)
- Cache Enum.values() calls (Applied-Energistics-2-Unofficial #1109)
- fix Witchery Enum#values() spam (Hodgepodge #767)
- Fix allocations of mixins @WrapMethod in MixinModelFHC (GTNHLib #298)
- Cache frequent Enum#values() calls (EnderIO #223)
- Cache frequent Enum#values() calls (Galacticraft #123)
- cache EnumOre#values() (Railcraft #114)
- Cache frequent Enum#values() calls (ForestryMC #107)
- Avoid instantiating EntityItem in the render loop (Draconic-Evolution #99)
- Cache frequent Enum#values() calls (Binnie #86)
- cache enum values (nei-custom-diagram #64)
- cache frequent enum.values() calls (MagicBees #59)
- cache more IronChestType#values() (ironchest #37)
- cache IronChestType#values() (ironchest #36)
- cache DyeColor#values() (EnderCore #30)
- Cache enum
.values()(BetterQuesting #243) - Cache enum
.values()(BloodMagic #146) - Cache enum
.values()(Draconic-Evolution #109) - Cache enum
.values()(EnderZoo #16) - Cache enum
.values()(Et-Futurum-Requiem #111) - Cache enum
.values()(LogisticsPipes #133) - Cache enum
.values()(OpenBlocks #63) - Cache enum
.values()(Steve-s-Factory-Manager #23) - Cache more enum
.values()(Binnie #113) - Cache more enum
.values()(EnderIO #249) - Cache more enum
.values()(Jabba #53) - Cache more enum
.values()(LogisticsPipes #135) - Cache more enum
.values()(MagicBees #67) - Cache more enum
.values()(Opis #20) - Cache enum
.values()(Jabba #52) - Cache enum
.values()(Opis #18)
Less memory held after startup
The client holds about 33 MB less after startup. Hodgepodge loads each Forge advanced model (the .obj and Techne models many mods draw blocks with) once and shares it, where mods used to load their own copies: 31 MB in the PR author's full-pack measurement, and loading gets a little quicker. GregTech no longer keeps its log messages in memory when its logging is turned off (2 MB).
Shipped in: GT5-Unofficial #6542, Hodgepodge #851, InGame-Info-XML #39
LittleTiles splits large builds faster and loads crowded worlds
Placing a LittleTiles build that spans many blocks splits it into those blocks faster. A world where many LittleTiles blocks border each other no longer crashes with a stack overflow while it loads: LittleTiles blocks stop passing each neighbour update on to all of their tiles.
Shipped in: LittleTiles #113, LittleTiles #43
Large smelteries and the crafting station cost less
Large Tinkers' smelteries cost less tick time: an item that cannot melt because the tank is full waits until the tank changes instead of being checked again and again, and melting results are cached. The crafting station remembers the last recipe it matched, so shift-clicking a stack of crafts no longer stutters. Tinkers' blocks such as the drying rack, casting table and basin draw with fewer calls, and drawing Tinkers' tools no longer churns memory every frame.
Shipped in: TinkersConstruct #321, TinkersConstruct #307, TinkersConstruct #253, TinkersConstruct #304, TinkersConstruct #338
HoloInventory holograms over big inventories cost less
HoloInventory adds up the items of a hologram in one pass instead of comparing every stack with every other one, so looking at a chest full of different items costs your client less.
Shipped in: HoloInventory #59, HoloInventory #56
Project Red gate models take less memory
Project Red gates keep two baked models per gate part, normal and mirrored, instead of one for each of the 48 orientations a gate can face, and turn them into place while drawing.
Shipped in: ProjectRed #78, ProjectRed #77
Faster game startup
GregTech's delayed crafting-recipe pass at startup went from about 990 ms to about 70 ms in the PR author's full-pack test. GregTech, NH Core Mod and IFU recipes stop asking to remove recipes that do not exist, and GregTech registers each pipe recipe once where it registered most of them five times. Three passes that scanned every recipe map at load to patch platinum sludge, cerium and naquadah outputs are gone; those outputs are set where the recipes are made.
OpenComputers spends about 100 ms transforming classes at startup instead of 850 ms, and Tinkers' Construct about half a second less checking which textures exist. Hodgepodge fixes a Forge config routine that copied a long list option's whole text again for every entry: reading Forestry's backpack config took about 3 seconds and 7 GB of allocations and now takes 30 ms.
Shipped in 18 pull requests
- Fix pipe oddity in recipe registration (GT5-Unofficial #7779)
- Remove useless recipe removals (GT5-Unofficial #7773)
- Log useless remove recipe removals (GT5-Unofficial #7772)
- Remove useless recipe removal (IFU #31)
- Remove the platinum sludge overhaul scanning during bartworks' FMLLoadCompleteEvent event (GT5-Unofficial #7743)
- Remove cerium line scans in GTNHLanthanides' FMLLoadCompleteEvent event (GT5-Unofficial #7748)
- Remove NaquadahReworkRecipeLoader scans in GT's FMLLoadCompleteEvent event (GT5-Unofficial #7756)
- fix eoh recipe (GT5-Unofficial #8153)
- Add another pass of buffering for delayed removals (GT5-Unofficial #7786)
- Remove useless recipe removals (NewHorizonsCoreMod #1910)
- Add another pass of buffering for delayed removals (NewHorizonsCoreMod #1913)
- Replace Aspect.getAspect with direct references to aspect objects for thaum aspects (NewHorizonsCoreMod #1748)
- apply the PlatinumSludgeOverhaul directly into Binnie (Binnie #114)
- optimize asm transformer (OpenComputers #176)
- rewrite asm class transformer to java (OpenComputers #177)
- Improve perf of TextureHelper.textureExists (TinkersConstruct #292)
- Fix forge config memory bomb (Hodgepodge #775)
- Replace Enum.values() calls in forge configuration Property$Type (Hodgepodge #763)
Faster fluid conduit transfers
Ender Fluid Conduits copy fluid stacks less often and ask each connected tank for its contents once per transfer instead of twice. Reservoirs and EnderIO's fluid tanks compare fluids directly instead of looking up their IDs, so large fluid networks cost less CPU.
Shipped in: EnderIO #221, EnderIO #218
Non-tickable GT hatches
Some end-game hatches are now non-tickable and no longer consume mspt. This also include laser vacuum pipe.
Shipped in: GT5-Unofficial #5900, GT5-Unofficial #7682
Received packets are limited by time, not count
Your client now works through received packets for up to 5 ms per tick instead of stopping after vanilla's 1001. A crowd of entities easily sends more than that: the queue kept growing, and ping seemed to climb while the server's mspt stayed low. The client command /packetstats incoming lists the ten packet types that arrive most over the next 200 ticks, and /packetstats queue counts what is still waiting. The Hodgepodge options changeReceivedPacketCountLimitToTimeLimit and receivedPacketTimeLimit switch the limit and set its budget.
Shipped in: Hodgepodge #1003, Hodgepodge #1004, VillageNames #15
Ticking blocks, fluids and mobs no longer load chunks
Blocks at the edge of the loaded area no longer load the chunk next to them when they tick: crops, grass, mycelium, vines, fire, saplings, cocoa, mushrooms, stems, torches and farmland. Flowing water, lava and mod fluids stop at that edge too, and mobs no longer load chunks while they look for a path. In 2.8, a vine or grass block on the border of a chunk-loaded base kept loading its neighbour, which unloaded and loaded again, and server tick time climbed over hours until a restart. Forestry's fruit pods, soils, fluids and mushrooms, Galaxy Space's Barnarda C grass and saplings, and the RemoteIO Reservoir got the same fix. The Hodgepodge switches are preventLoadingChunksWhenTickingBlocks, preventLoadingChunksWhenLiquidsFlow and preventLoadingChunksWhenPathfinding, all on by default.
Shipped in: Hodgepodge #778, Hodgepodge #771, Hodgepodge #787, Hodgepodge #782, ForestryMC #110, Galaxy-Space-GTNH #146, Galaxy-Space-GTNH #142, RemoteIO #25
BuildCraftOilTweak
#3 Optimized mod detection checks in the living update handler to improve performance. - @danyadev

CodeChickenCore
- #42 Optimized class hierarchy transformation performance, reducing load time from 342ms to 128.7ms. This speeds up game startup and resource reloading. - @danyadev
GT5-Unofficial
#7698 The renderers for the Antimatter Generator, Blackhole, Wormhole, Nano Forge and drone models, plus the work area overlay, now use a modern shader path when Angelica 2.1 is installed. They fall back to the old path when it is not. Most render setup now happens at startup or on resource reload, so the first frames should stall less. A Space Elevator bug where the saved wait time was read wrongly from NBT is also fixed. - @mitchej123
#7563 GregTech machines and pipes no longer run client ticks unless they need them. The profile in the PR shows World.updateEntities dropping from 36.21 to 12.91 in total time. Machine sounds now update when their state changes instead of being checked every tick. - @mitchej123
- Note: Addon multiblocks, tanks, hatches, buffers, cables, pipes and frames no longer get onPreTick/onPostTick on the client unless they override needsClientTick() to return true. setBaseMetaTileEntity is now final in MetaTileEntity and MetaPipeEntity, and classes implementing IMetaTileEntity directly must add needsClientTick() and onClientSoundStateChanged().
#6680 The loader that generates fluid-instead-of-cell multiblock recipes runs faster during game loading, going from 127 ms to 13 ms. - @danyadev

#6674 The platinum sludge recipe loader runs faster during game loading, going from 228.5 ms to 83.5 ms. The recipes are unchanged. - @danyadev

#6491 Startup is faster because recipe removals that use non-default options are now buffered and done in bulk. The author measured 228 ms saved in a profile. - @danyadev

#6476 Recipe loading is almost 4 seconds faster. Four dusts now have duplicate recipes for small and tiny piles: Ammonium Nitrate, Ancient Granite, Runite and Sodium Nitrate. Huge Clay Fluid Pipe gets a sixth duplicate recipe, where it had five before. - @danyadev
#6468 Removing furnace recipes during loading is much faster. It went from about 10% of GregTech loading time to 0.01%, which saved about 1.4 seconds on the author's machine. - @danyadev

#5882 Input buses and Linked Input Buses now compact their item slots faster. This removes lag reported with these buses. - @danyadev

#5844 Leaving a world is faster. A handler that could take 100 ms even in a small pack no longer runs on leave, when it had nothing to do. - @danyadev
...and 14 smaller change(s) in GT5-Unofficial, listed in the by-mod files.
GuideNH
#73 Guide reload takes less time and memory. Total reload work went from 574 ms to 413 ms, and sampled allocations dropped from 649 MiB to 303 MiB. - @danyadev
#70 Optimizes GuideNH resource loading by scanning resource packs once instead of twice and only reading markdown frontmatter during indexing, saving ~700ms on startup. - @danyadev

...and 2 smaller change(s) in GuideNH, listed in the by-mod files.
lwjgl3ify
- #331 Class transformer checks during loading are faster. The checks now use a shared byte pattern matcher from RetroFuturaBootstrap. - @danyadev
- ...and 1 smaller change(s) in lwjgl3ify, listed in the by-mod files.
StructureLib
#54 Adding multiblock shapes during loading is faster. In the Forge of Gods example, the time dropped from 161 ms to 60.7 ms. - @danyadev

MatterManipulator
- #24 Class transforming at startup spends less time in the DeMemberator transformer. It now skips classes outside the Matter Manipulator package, which cut its time from 45.4 ms to 9.5 ms. - @danyadev
Contributors
Everyone who authored, reviewed or co-authored a change on this page, with how many of them:
@Alexdoru (132), @boubou19 (82), @UltraProdigy (26), @danyadev (20), @mitchej123 (19), @Dream-Master (14), @DarkShadow44 (12), @Nikolay-Sitnikov (12), @Caedis (9), @Algent (8), @Kogepan229 (7), @koolkrafter5 (6), @sisyphussy (6), @AnsonYeung (4), @ABKQPO (3), @glowredman (3), @kurrycat2004 (3), @Luca-Guettinger (3), @MalTeeez (3), @OvermindDL1 (3), @RecursivePineapple (3), @slprime (3), @tiffit (3), @wlhlm (3), @cubefury (2), @EnderProyects (2), @Guvante (2), @lc-1337 (2), @leagris (2), @POPlol333 (2), @Pxx500 (2), @Ruling-0 (2), @Sanduhr32 (2), @0hwx (1), @combusterf (1), @Connor-Colenso (1), @eigenraven (1), @Glease (1), @JustACasualDay (1), @LazyFlesh (1), @MLGfruitshoot (1), @Nana-Sakura (1), @S4mpsa (1), @SwingURM (1), @Worive (1)