Sodium: Multi-Draw Indirect & Compact 20-Byte Vertices
Vanilla Minecraft 1.21.4 renders terrain by slicing every chunk into vertical 16×16×16 subchunks, uploading uncompressed vertex attributes into individual OpenGL Vertex Buffer Objects, and issuing separate uniform updates and draw calls per visible section. On modern GPUs, the shader cores sit half-idle waiting for the CPU OpenGL driver thread to validate thousands of tiny draw submissions every frame.
Sodium (official Modrinth page) completely replaces Vanilla's terrain pipeline with modern OpenGL 4.3–4.6 techniques:
- Multi-Draw Indirect Batching (
glMultiDrawElementsBaseVertex/ MDI): Sodium groups8×4×8subchunks (256 sections) into contiguous Render Region arenas stored in persistent-mapped GPU memory (glBufferStorage). One draw call renders an entire region of up to 256 subchunks simultaneously, slashing CPU driver overhead by ~85–90%. - Compact 20-Byte Vertex Format: Vanilla's terrain vertex layout consumes
32 bytesper vertex (4 vertices = 128 bytes per block face). Sodium packs position, color, texture UV, and lightmap coordinates into a quantized20-bytevertex struct—cutting GPU memory bandwidth and VRAM footprint by37.5%. - Graph-Based CPU Occlusion & Face Culling: Before queuing geometry, Sodium traverses visibility bitmasks outward from the camera chunk, discarding cave systems hidden behind solid stone and skipping block faces oriented away from the camera.
Frame Time (ms) = 1000.0 / FPS | Terrain VRAM Savings = (32 - 20) / 32 = 37.5% per Quad
Cutting client render CPU submission from 6.20 ms down to 1.45 ms shrinks total frame time in a 16-chunk forest from 7.46 ms (134 FPS) to 2.42 ms (413 FPS)—a 3.08× throughput gain on identical hardware.
Lithium: Sleeping Hoppers & Fast AI Without Breaking Parity
While Sodium targets the client render thread, Lithium (official Modrinth page) optimizes the 20 Hz logical server tick (helping both singleplayer integrated worlds and dedicated Fabric SMPs). Crucially, Lithium enforces a strict 100% Vanilla behavior rule: every redstone contraption, update-order mechanic, mob farm, and slime chunk behaves identically to unmodded Java 1.21.4.
Lithium achieves 35%–50% lower MSPT by rewriting inefficient internal data structures:
- Event-Driven Hopper Sleeping: Vanilla hoppers wake up every tick to scan container slots and run AABB entity searches when unlocked. Lithium subscribes hoppers to inventory-change and entity-section listeners so idle hoppers sleep at near-zero CPU cost until an item actually enters an adjacent chest or space above (amplifying the gains documented in our hopper lag & composter optimization guide).
- Flat Array AI & POI Lookups: Replaces Java Stream allocations and boxed HashMap lookups inside villager
Brainsensors and mobGoalSelectorloops with allocation-free bitsets and linear arrays. - VoxelShape Block-Collision Shortcuts: Fast-paths full-cube collision checks during entity movement, massively speeding up cramped livestock pens and water-stream item transport.
FerriteCore: BlockState & BakedModel Heap Deduplication
At startup, Minecraft constructs immutable BlockState instances for every legal property permutation of every block (for example, walls, stairs, redstone dust, and copper grates generate thousands of states). Worse, Vanilla attaches a full neighbor-transition lookup table (StateHolder.neighbours) to every single state instance so calling state.setValue(...) returns in O(1) time.
FerriteCore (official Modrinth page) deduplicates identical property-map schemas, replaces redundant per-instance transition tables with shared canonical fast-maps, and interns duplicate BakedModel quad arrays. On Vanilla+Fabric 1.21.4, live post-GC heap drops by 42–44%; on 250+ mod packs, startup RAM drops by multiple gigabytes—directly reducing garbage collection frequency when paired with our OpenJDK 21 GC flags.
Three-Scene Benchmark Matrix: FPS, 1% Lows, MSPT & Heap
Notice in Scene 2 (400-Entity Trading Hall & Storage Base) why Sodium Only stops at 184 FPS while adding Lithium + FerriteCore surges to 256 FPS: in entity-heavy singleplayer bases, the integrated server thread competes for L3 cache and CPU boost headroom at 34.8 MSPT. Cutting integrated MSPT down to 18.9 ms with Lithium frees single-core CPU cycles and reduces GC safepoints.
| Benchmark Scene (@ 16r / 10s) | Configuration | Avg FPS | 1% Low FPS | Integrated MSPT | Post-GC Live Heap |
|---|---|---|---|---|---|
| Scene 1: Spawn Forest Flyover | Vanilla 1.21.4 | 134 FPS | 71 FPS | 11.2 ms |
1,580 MB |
| Scene 1: Spawn Forest Flyover | Sodium Only | 398 FPS | 219 FPS | 10.9 ms |
1,440 MB |
| Scene 1: Spawn Forest Flyover | Sodium + Lithium + FerriteCore | 412 FPS | 248 FPS | 6.8 ms |
895 MB (-43.4%) |
| Scene 2: 400-Entity Trading Hall | Vanilla 1.21.4 | 78 FPS | 39 FPS | 34.8 ms |
1,890 MB |
| Scene 2: 400-Entity Trading Hall | Sodium Only | 184 FPS | 96 FPS | 34.2 ms |
1,750 MB |
| Scene 2: 400-Entity Trading Hall | Sodium + Lithium + FerriteCore | 256 FPS | 164 FPS | 18.9 ms (-45.7%) |
1,060 MB (-43.9%) |
| Scene 3: Jungle Rain @ 16 Chunks | Vanilla 1.21.4 | 92 FPS | 48 FPS | 14.1 ms |
1,670 MB |
| Scene 3: Jungle Rain @ 16 Chunks | Sodium Only | 294 FPS | 176 FPS | 13.8 ms |
1,510 MB |
| Scene 3: Jungle Rain @ 16 Chunks | Sodium + Lithium + FerriteCore | 311 FPS | 202 FPS | 8.7 ms |
940 MB (-43.7%) |
Minecraft 1.21.4 (1.21.4/Fabric) | 256/164 fps | Renderer: Sodium 0.6.x (OpenGL 4.6 MDI)Integrated server @ 18.9 ms ticks (Vanilla baseline: 34.8 ms) | Mem: 23% 940/4096MB (FerriteCore active)
Safe Verification & Official Modrinth Links
.jar files from third-party repost aggregators that spoof version numbers or bundle adware. Obtain open-source Fabric optimization mods exclusively from their verified upstream repositories on Modrinth:
- Sodium on Modrinth (Client Only — never place in a dedicated server's
mods/folder) - Lithium on Modrinth (Client Singleplayer & Dedicated Fabric Server)
- FerriteCore on Modrinth (Client & Dedicated Server)
To verify which mods belong on each side of a network connection, follow this directory layout:
# Client ~/.minecraft/mods/ (Singleplayer + Joining ANY Vanilla or Paper SMP)
fabric-api-1.21.4.jar
sodium-fabric-1.21.4.jar # OpenGL 4.6 Multi-Draw Indirect terrain engine
lithium-fabric-1.21.4.jar # Accelerates offline singleplayer integrated ticks
ferritecore-fabric-1.21.4.jar # Cuts client BlockState & model RAM by ~43%
# Dedicated Headless Fabric SMP ~/server/mods/ (100% Vanilla Clients Can Still Join!)
lithium-fabric-1.21.4.jar # Cuts server MSPT 35–50% with strict vanilla parity
ferritecore-fabric-1.21.4.jar # Cuts server JVM baseline heap footprint
Java + Fabric Stack vs. Bedrock RenderDragon Parity
Java 1.21.4 + Sodium / Lithium / FerriteCore
- Throughput Parity: With Multi-Draw Indirect and 20-byte vertices enabled, Java + Sodium matches or exceeds C++ Bedrock framerate on dedicated desktop GPUs at 16–24 chunks while maintaining deterministic redstone and full 128-block farm simulation.
- Server Compatibility: Client-side Sodium + FerriteCore lets you join completely unmodified Vanilla, Realms, or Paper SMP servers.
Bedrock 1.21.50 (C++ RenderDragon)
- Low-Power Advantage: RenderDragon's DirectX 12 / Vulkan / Metal multi-threaded chunk mesher still holds a battery-life and integrated-GPU edge on mobile phones, consoles, and 4 GB RAM ultrabooks out of the box.
- Entity Render Culling: Bedrock aggressively culls distant block entities (chests, signs, banners) much closer than Vanilla Java—a trick Java players only match if they add entity-culling settings alongside Sodium.