Overclocked - A Mekanism Fork

A performance-focused fork of Mekanism that lowers tick time on large bases. Optimized item pipes, energy/fluid/chemical networks, heat, the Digital Miner, and radiation. Drop-in works with existing addons and saves.

Mekanism: Overclocked

Mekanism: Overclocked is an unofficial, performance-focused fork of Mekanism by Aidan C. Brady (bradyaidanc) and contributors. It is not affiliated with or endorsed by the Mekanism team.

How this fork differs from upstream Mekanism

Mekanism: Overclocked keeps the mekanism mod id and every module id, so it is a drop-in replacement: existing saves load unchanged and existing Mekanism addons continue to work against it.

Every change below is behavior-preserving. Machines, networks, recipes, and configuration behave exactly as they do in upstream Mekanism; what changed is how much work the game does to produce that behavior. The focus is on the systems that run every tick on large bases (item routing, cable networks, heat, the Digital Miner, and radiation), where reducing per-tick work and short-lived allocations translates directly into lower server tick time and less garbage-collection pressure.

Item transport and pathfinding

The logistical transporter pathfinder and item routing received the largest set of changes, since they run frequently on large item-sorting setups.

  • Priority-queue A*: The pathfinder previously scanned the entire open set on every step to find the lowest-scoring node, an O(n) sweep per node. It now uses a priority queue, reducing the per-step cost to O(log n). On large transporter networks this substantially lowers the cost of recalculating routes.
  • Allocation-free node walking: The search reuses a single mutable block position instead of allocating a new position object for every node visited, and compares squared distances to avoid a square-root call per node.
  • Packed-long position lookups: Network transmitter lookups and the path cache now key on packed long positions instead of BlockPos objects, removing a large amount of short-lived allocation and map-key hashing. The path cache also moved to a fastutil map.
  • Single-pass best-path selection: Choosing the cheapest destination no longer builds and sorts a full list of candidate paths; the best path is selected in one pass.
  • Cached path index: A transporter stack caches the index of its current position within its path instead of performing a linear indexOf scan of the path on every movement step.
  • Shared inventory snapshot: When predicting inserts into an inventory that exposes the same handler on multiple sides, the inventory is read once and shared across those sides instead of being rescanned per side.
  • Lazy work in the transit loop: The per-tick transporter update only allocates its "to delete" set when something actually needs removing, skips the pull logic entirely on transporters with no pull side, and only builds the client sync packet when a player is actually tracking that chunk.

Cable and pipe networks (energy, fluid, chemical)

  • Reusable distribution target: Energy, fluid, and chemical networks previously allocated a fresh distribution target (and its backing lists) every tick they emitted. These are now reused across ticks and reset in place, removing steady-state per-tick allocation on every active network. A unit test confirms that a reset and reused target distributes identically to a freshly created one.
  • Stream removal on hot paths: Transmitter connection checks replaced a stream/lambda with a plain loop to avoid per-neighbor allocation during connection refreshes.

Heat networks

  • Idle heat networks sleep: Thermodynamic conductor networks now detect when they have reached thermal equilibrium (every conductor at ambient temperature with no pending heat) and stop simulating until something perturbs them. Adding or merging conductors, a neighboring heat source, or any heat actually entering the network wakes it back up. Previously every heat network simulated all of its conductors every tick whether or not anything was changing.
  • Allocation-free adjacency: Heat transfer between conductors uses packed long positions instead of allocating a block position per connected side per tick.

Digital Miner

The block search that the Digital Miner runs on a background thread was reworked to scan less and allocate less:

  • Per-block verdict cache with split checks: Filter evaluation that depends only on the block type is computed once per unique block and cached, while the checks that depend on the specific block state or position (and the unbreakable and destroy-speed checks) only run after a block has already matched the filters.
  • No per-position allocations: The search reuses a single mutable block position across the whole region instead of allocating one per block, and avoids allocating an item stack per block during filter matching.
  • Cheaper bounding-block skip: Bounding blocks are identified by a direct block-type check rather than a tile-entity lookup per position.
  • Empty-region short-circuit: If every loaded chunk in the search region is empty within the mined Y range, the search exits immediately instead of walking every position. The region cache also caches its empty-chunk placeholder rather than reallocating it on each lookup.
  • Large-region safety: Region size is computed with long math and guarded against overflow, so very large radii fail cleanly instead of silently misbehaving.

Radiation system

  • Spatial index for sources: Radiation sources are indexed by chunk. Computing the radiation level at a position only examines sources in nearby chunks rather than iterating every source in the dimension, and add, remove, and decay operate on the chunk index directly.
  • Closed-form decay time: Decay-time calculation replaced an iterative loop that stepped second-by-second until the magnitude fell below threshold with a direct logarithmic formula, and correctly reports a non-decaying configuration as infinite.
  • Batched client sync: Radiation changes within a tick mark the affected dimension dirty and send a single client update per dimension at the end of the tick, instead of re-syncing all clients on every individual change.
  • Skip work when nothing is irradiated: Per-entity radiation processing exits early when there are no environmental sources and the entity is not already irradiated.
  • Dimension-scoped player iteration: Client radiation updates iterate only the players in the affected dimension instead of every player on the server.
  • Particle cap: Client radiation particle spawning is capped per tick to avoid pathological particle counts at high configuration values.

Rendering

  • Allocation-free transporter rendering: The logistical transporter renderer no longer allocates a list, set, and position array each frame. It reuses persistent buffers, uses a mutable lookup key to de-duplicate identical in-transit stacks, and writes stack positions into a shared array.

Compatibility

  • The mod id remains mekanism; module ids remain mekanismadditions, mekanismgenerators, and mekanismtools. Addons that depend on Mekanism continue to load.
  • Saves, configuration (still stored under config/Mekanism/), and recipes are unchanged.
  • All optimizations preserve existing behavior. They change how work is done, not what machines and networks do.

License

Mekanism is licensed under the MIT License, and Mekanism: Overclocked is distributed under that same MIT License in full compliance with it. Copyright for the original work remains with Aidan C. Brady and the Mekanism contributors, and the original LICENSE file is included unchanged in this project's source and distributed files. See the original project at https://github.com/mekanism/Mekanism.

The Overclocked - A Mekanism Fork Team

profile avatar
  • 10
    Followers
  • 9
    Projects
  • 131.9K
    Downloads
Donate

More from texboobcatView all