Tags
Creators
Details
1.8.5
Compatibility
Changes
Major Performance Overhauls
I was working to improve performance on my next mod mob detection when I figured that I would take my time looking over and optimizing my older code. Heres what has changed.
TLDR; It is much more optimized. Please use this version hence the version numbering.
- GC Micro-stutters: Completely overhauled the volumetric scanning system (BFS) used for ambient dust generation. The mod now recycles memory internally using static
ArrayDequeandHashSetstructures rather than creating thousands of temporary objects every few ticks.
- ~90% reduction in memory allocation churn, which should eliminate major GC induced lag spikes.
- ~90% reduction in memory allocation churn, which should eliminate major GC induced lag spikes.
- Primitive Maps via FastUtil: Purged standard Java
ConcurrentHashMapcaches in favor of FastUtil'sLong2IntOpenHashMapandLong2ObjectOpenHashMap. This stops Java from constantly boxing primitivelongcoordinates into bloatedLongobjects, should save massive amounts of hidden memory churn. - Distance Based Simulation LOD: Added a Level of Detail (LOD) check to the particle tick loop. Dust particles further than 16 blocks away from the player now skip expensive wind, lighting, and thermal math.
- Temporal Interleaving: * Maximized the mod's custom
tickOffsetstaggering system. Instead of all 1,200 particles calculating their environment on the exact same frame, the mod splits the workload, forcing only 5% of active particles to calculate heavy environmental physics per frame. - Optimized Mod Compatibility Layer: Replaced Java Reflection with native JVM
MethodHandlesfor Curios and Accessories integration. Additionally, adjusted the slot scanning routine to check for handheld lights every 5 ticks instead of every single tick.
- ~60% faster compatibility layer execution, saves up to 80% of CPU cycles previously spent on inventory polling.
- ~60% faster compatibility layer execution, saves up to 80% of CPU cycles previously spent on inventory polling.
- Config Caching: Particle properties (such as gravity, bounce forces, and wind deflection rules) are now cached locally as primitive values the moment a dust particle is spawned. This prevents thousands of active particles from concurrently invoking Forge's synchronized config map lookups every single frame.
- ~85% drop in config related thread stalls, should massively improve FPS when theres a lot of particles on screen.
- ~85% drop in config related thread stalls, should massively improve FPS when theres a lot of particles on screen.
- Blockstate Checks for Thermal Drafts: Block searches for heat sources (Lava, Magma, Fire) have been changed to poll every 20 ticks (1 second) instead of 10. The physical force applied to the particles has been scaled to compensate for the delay, you will notice it a little bit but I doubt people are looking that closely to see.
- 50% fewer
getBlockState()chunk lookups.
- 50% fewer
- Thermal Draft Physics: Turned off physics, and player interactions when dust is affected by therumal updraft.
- Should significantly reduce FPS drops when above or near lava pools or large amounts of heat sources.
- Should significantly reduce FPS drops when above or near lava pools or large amounts of heat sources.
Old vs New
Note: Data represents estimated (not experimental) performance scaling in a dense underground cave environment in many different environments using an RTX 3090 with default settings.
| Metric | v1.7.5 (Old) | v1.8.5 (New) | Net Improvement |
|---|---|---|---|
| Peak FPS | ~75 FPS | ~121 FPS | + 61% |
| 1% Lows | ~27 FPS | ~53 FPS (Avg) | + 96% |
| Avg Tick Time | ~18.5 ms | ~6.2 ms | - 66% |
| Memory Heap Churn Rate | ~450 MB/s | ~250 MB/s | - 56% |
| World BlockState Lookups / sec | ~8,400 | ~4,200 | - 50% |
Bug Fixes
- Critical Lava Pool Lag Fix: Fixed a severe flaw where ambient dust would continuously spawn inside lava pools (because of the high light level) and fail to despawn instantly. Fluid collision checks now run instantly every tick, and the volumetric spawner strictly ignores fluid blocks, fixing a massive FPS drain in the Nether and deep caves.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:bc9u3UPM:GL4wfPUH"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:bc9u3UPM:GL4wfPUH"
}

