-
Notifications
You must be signed in to change notification settings - Fork 0
Performance and Memory Impact
Dasik (Rifaditya) edited this page Aug 9, 2026
·
1 revision
Stack Size Adjuster is designed for maximum efficiency, zero memory overhead, and zero NBT bloat.
-
Primitive Value Storage: Active limits are stored in
volatile intprimitive fields withinStackSizeManager, ensuring$O(1)$ lock-free read access during stack size calculations. -
Zero NBT Inflation: Unlike custom item mods that inject custom NBT tags to track stack sizes, Stack Size Adjuster hooks directly into vanilla component data (
DataComponents.MAX_STACK_SIZE) andExtraCodecs.intRange(1, Integer.MAX_VALUE). Saved world sizes remain 100% identical to vanilla. -
No Tick Listeners: The mod executes zero logic in tick loops (
EndTick,WorldTick). Code is executed purely on-demand during item queries, command invocations, or container drops. -
Fast Thread-Safe Overrides: External addon overrides are maintained in a
CopyOnWriteArrayList<BiFunction<Item, Integer, Integer>>, providing thread-safe lock-free iteration.
| Metric | Measured Impact | Optimization Mechanism |
|---|---|---|
| Heap Memory Allocation | Zero transient object creation during stack checks | |
| World Save Data Footprint | Primitive component codec modification | |
| Server Tick Overhead (MSPT) | Lock-free primitive reads; zero tick loops | |
| Container Breaking MSPT |
InventoryDropHelper entity spawn cap |
๐ Repository Source Disclaimer: The documentation in this Wiki reflects the current source code state in the repository, which may include recent unreleased commits or developmental features ahead of public release builds on CurseForge and Modrinth.
Copyright ยฉ 2026 Dasik (Rifaditya). Licensed under the GNU General Public License v3.0 (GPLv3).
๐ Home
- Dynamic GameRules
- Category Stack Limits
- Container Drop Optim.
- Large Chest Overflow
- ModMenu & YACL Config
- Item Count Rendering
- Item Clumps Synergies
- Troubleshooting & FAQ
- Developer Setup
- Architecture Layout
- Mixin Reference
- Addon Override API
- Network Sync Protocol
- Give Command Handling
- Behavior Profiles
- Consumer Mods Guide
- Performance Impact
- Advancements Matrix
- Author: Dasik (Rifaditya)
- License: GPL-3.0-or-later