Modscraper Modscraper Minecraft
Jasione logo

Jasione

Mod

by decce

Reduce GC pressure by safely eliminating Enum#values array cloning and memory allocation overhead through bytecode analysis

Type

Mod

CurseForge Downloads

587,121

CurseForge ID

1595495

Modrinth Downloads

301,768

Modrinth ID

qlDkBPij

Last Updated

Nov 26, 2026

Description

Jasione

Overview

Jasione is an optimization mod that reduces memory allocation (GC pressure).

The Java compiler generates, for each enum class, a values() method that can be used to retrieve all enum values as an array. This method clones the array before returning it, ensuring that callers of this method can safely mutate the array without affecting other callers. This, however, incurs a performance cost. When invoked in hot paths, these small memory allocations accumulate and increase GC pressure.

Jasione addresses this issue by redirecting the values() calls that do not mutate the returned array to use a cache, eliminating the cloning overhead and the memory allocation. For details on how this is implemented safely, see to the "Technical Details" section below.

Configuration

Jasione currently offers several debug options, which can be used to inspect the optimization result. The configuration resides in config/jasione.toml.

#Specifies whether to enable the mod
enabled = true

[debug]
	#When enabled, logs statistics when optimizations are applied
	printOptimization = false
	#When enabled, dumps transformed classes to the ".jasione.out" folder
	dumpClasses = false

FAQs

Doesn't the JIT optimize the Enum#values() calls when they're safe?

No, the JIT compiler doesn't currently recognize even the most trivial use patterns like iterating through the values array. The cloning and memory allocation overhead persists, per JMH tests.

NeoForge displays a warning about this mod. Why?

When running this mod on the latest NeoForge (1.21.11+), you may encounter this warning:

[Render thread/ERROR] [ne.ne.fm.cl.tr.ClassTransformStatistics/]: Class processor jasione:main transformed 100.00% of loaded class which is suspiciously high; it may be attempting mass-ASM. Please report this to the mod author.

According to members of the NeoForge team, this message essentially acts as a nudge for mod authors to identify whether the use case is necessary. For Jasione, this transformation is necessary. (See the previous question)

For reference, see discussion on "The NeoForged Project" discord server (note that the discussion involved different implementations which didn't become the final version due to various issues. See the "Technical Details" section for more detail.)

Technical Details

The contract of Enum#values (where Enum refers to any enum class) is that the returned array is fresh and can be freely mutated. Therefore, we must identify which callers are safe to optimize by analyzing whether they mutate the array or the array escapes. This is made possible by utilizing the asm-analysis library. If array mutation or escapes are detected via bytecode analysis, the call remains unchanged to preserve correctness.

We need to find a place to store the cached values array, because the synthetic $VALUES field for enum classes is private. The current implementation performs runtime class generation. For each enum class, a corresponding cache holder class is generated to store the values array as a static final field. For example, when the transformer first detects use of net.minecraft.core.Direction#values, it generates the class me.decce.jasione.cached.net.minecraft.core.Direction, which holds a cached values array and various other metadata to ensure correctness. With this, it can transform all callers of the original values() method to use the cached class.

Recommended Gear

Affiliate

Hardware and extras that pair well with this mod.

As an Amazon Associate I earn from qualifying purchases.

Similar Mods

Included in Modpacks (91)

Show fewer
Linggango Linggango Legendary Edition Legendary Edition Keo optimized Keo optimized Vulkan Optimized Vulkan Optimized Re-Console+ Re-Console+ Rapid Optimization Rapid Optimization KEO RPG optimized KEO RPG optimized NeoTech Reborn NeoTech Reborn Modded Together Modded Together Voxyris Voxyris Requiem - BETTER FANTASY (The Last Act) Requiem - BETTER FANTASY (The Last Act) Desecrated - Flesh and Blood Desecrated - Flesh and Blood Kuri's Fresh (Actions & Stuffs recreation) Kuri's Fresh (Actions & Stuffs recreation) Simply Legacy Simply Legacy Mystic's Monstrosity - Greedy Edition Mystic's Monstrosity - Greedy Edition Big Globe Optimized (FORGE) Big Globe Optimized (FORGE) crazy craft even more updated crazy craft even more updated Farming Overloaded Farming Overloaded Simple Performance Simple Performance Vital Modpack Vital Modpack Pix Android Boost Pix Android Boost Velocity Velocity Big Globe Optimized [NEO/FORGE/FABRIC] Big Globe Optimized [NEO/FORGE/FABRIC] SF Integrated Modpack SF Integrated Modpack Kuri's FreshVanilla Kuri's FreshVanilla Performa Performa Mirabilis - Vanilla Plus Plus! Mirabilis - Vanilla Plus Plus! ROG Ally Modpack ROG Ally Modpack KRILLKRAFT KRILLKRAFT Heartful Memories Heartful Memories Crafted Madness: Modern Era Crafted Madness: Modern Era Foodie’s QoL Pak Foodie’s QoL Pak Big Globe Optimized (FABRIC) Big Globe Optimized (FABRIC) Danmo Danmo Fiction Friction Gaming Fiction Friction Gaming Forge of Eternity Forge of Eternity Raven's High Fantasy Raven's High Fantasy Borukva Modpack Borukva Modpack Mystic's Monstrosity - Avaricious Edition Mystic's Monstrosity - Avaricious Edition VictoriaCraft VictoriaCraft TchicX Modpack TchicX Modpack Caffeine Caffeine Economycraft Economycraft Monumental Experience - Beneath the Surface Monumental Experience - Beneath the Surface Client Refresh Client Refresh Cornetto Cornetto Riptidium Riptidium Beta Decay Beta Decay Statera Statera Create AeronauticsPLUS Create AeronauticsPLUS Lurker in the Fog: Herobrine’s Dominion Lurker in the Fog: Herobrine’s Dominion Age Of Titans Age Of Titans FluxEngine - Ultra Performance & Ultimate FPS Boost FluxEngine - Ultra Performance & Ultimate FPS Boost Sherbert Sherbert Avalore (Modpack) Avalore (Modpack) Terraclysm Terraclysm Matt Optimized Matt Optimized LiteHearted LiteHearted Sengoku Chronicles Sengoku Chronicles Silent Cities - Zombie Apocalypse Silent Cities - Zombie Apocalypse EndlessPixel-Modpack EndlessPixel-Modpack CATpack CATpack Panas RPG - Create, Dungeons,  Exploration  Optimized 1.20.1 Panas RPG - Create, Dungeons, Exploration Optimized 1.20.1 TSpack TSpack Slemprix's Essentials Slemprix's Essentials Andromeda Andromeda Potato PC [Low End, FPS Boost, Performance, Optimization, Low Spec, Lag Fix, Lightweight, Smooth Gameplay] Potato PC [Low End, FPS Boost, Performance, Optimization, Low Spec, Lag Fix, Lightweight, Smooth Gameplay] Sorbet Sorbet Vanilla Expanse Tensura - A Weakened Hierarchy Tensura - A Weakened Hierarchy Tensura - A Human's Uproar Tensura - A Human's Uproar Deepa's Monumenta Pack Deepa's Monumenta Pack Shades 'n' Shine Shades 'n' Shine A Simple Efficient & Optimized Lite (ASEO Lite) A Simple Efficient & Optimized Lite (ASEO Lite) Lumora Lumora Superior Performance Superior Performance [balls_game_2] [balls_game_2] BananaMC BananaMC Vanilla Cataclysst Vanilla Cataclysst By Design MDSMP Refresh MDSMP Refresh Refabricated Villagers: Vanilla+ Refabricated Villagers: Vanilla+ a Totally Normal Vanilla+ Modpack a Totally Normal Vanilla+ Modpack X-Factor Optimization X-Factor Optimization Expanded Adventures: Vanilla+ Expanded Adventures: Vanilla+ Teushitties Revenge 3D: Dorfeldt Fucking Dies Teushitties Revenge 3D: Dorfeldt Fucking Dies Carbon Edition Carbon Edition Liye Liye lilacs lilacs Create Squared Create Squared WhereMyOptimizer WhereMyOptimizer

External Resources