Главная › Моды › Оптимизация › Jasione

Jasione

Jasione

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

Jasione — мод для Minecraft 1.18.2–26.3 из категории «Оптимизация» для загрузчиков Fabric, Forge, NeoForge, Quilt. Автор: decce6. В Lorix можно добавить мод в сборку — нужные зависимости подтянутся автоматически — и скачать её одним ZIP с папкой mods/ или запустить в Lorix Launcher одной кнопкой.

Категория
Оптимизация
Загрузчики
Fabric, Forge, NeoForge, Quilt
Версии Minecraft
26.3, 26.2, 26.1.2, 26.1.1, 26.1, 1.21.11, 1.21.10, 1.21.9, 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2
Скачиваний на Modrinth
319 762

Описание

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.

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:

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)

Как установить Jasione

  1. Скачайте Lorix Launcher и создайте сборку с нужной версией и загрузчиком.
  2. Найдите Jasione в окне модов — зависимости добавятся сами.
  3. Нажмите «Играть».

Или соберите модпак в конструкторе и скачайте ZIP: папку mods/ из архива положите в .minecraft.