Перейти к содержимому
Mineforgian

RailOptimization

A simple mod that makes powered/activator rails turn on/off up to 10x faster.

Загрузки
472K
Подписчики
121
Обновлён
24 августа 2026 г.
Лицензия
GPL-3.0-only

Опубликован 15 ноября 2023 г.

Description

RailOptimization is a lightweight mod that makes powered rails and activator rails turn on and off up to 10x faster in complex rail networks.

The best result is that you notice nothing while it is operating, except smoother and faster rail updates. The mod optimizes rail redstone updates. Vanilla behavior and the default power range are preserved unless you explicitly change the range.

Features

  • Faster powered rail and activator rail activation and deactivation.
  • Optimized updates across straight, ascending, descending, and mixed rail networks.
  • Reduced work for repeated neighbor updates that do not change rail state.
  • Optional powered/activator rail range from 1 to 64; the vanilla default remains 8.
  • Runtime switch between optimized and vanilla update logic for compatibility checks.
  • Fabric-native implementation with no Architectury API dependency.

Performance

Current release-build benchmarks measured state-changing updates at 7.56x faster on straight rail lines and 9.90x faster on mixed slopes than vanilla. A repeated unchanged-update scenario measured up to 32.36x faster.

Results vary with hardware, server load, rail layout, power range, and other installed mods. These figures describe the included benchmark scenarios and are not a guarantee for every world.

Commands

  • /railoptimization shows the current optimization state and power limit.
  • /railoptimization on and /railoptimization off require administrator permission.
  • /railoptimization powerLimit <value> requires administrator permission and accepts values from 1 to 64.

Command settings return to their defaults after the game or server restarts.

Compatibility Notes

  • RailOptimization v1.2 and earlier are incompatible with Carpet TIS Addition. RailOptimization v1.3 and later are compatible.
  • If a contraption or another mod behaves differently from vanilla, use /railoptimization off for an immediate comparison and include a minimal reproduction when reporting the problem.

Acknowledgements

RailOptimization began as a fork of FxMorin's RailOptimization. My sincere thanks go to FxMorin and the original contributors for their work. The current implementation has since been extensively rewritten, but this project would not exist without their original work.

More Information

For source code, issue reports, or any other questions, please visit the RailOptimization GitHub repository.

Ченджлог

2.0-snapshot-2Бета26.1.1, 26.1.2, 26.2 · 24 августа 2026 г.

RailOptimization v2.0-snapshot 2

This snapshot hardens the new v2.0 rail update engine, improving cache performance and vanilla parity for dynamic redstone sources and concurrent dimension ticking.

🚀 Performance

  • Local release-build benchmarks measured state-changing updates at 7.56x faster on straight lines and 9.90x faster on mixed slopes than vanilla
  • In the same release build, unchanged updates measured 5.41x faster when unpowered, 3.45x faster when directly powered, and 32.36x faster at distance 8 from an indirect power source
  • Reworked rail-search hashing to mix all BlockPos coordinate bits, eliminating direction-dependent collisions on flat rail lines
  • At powerLimit=64, state-changing updates measured 176-191 microseconds per operation on straight lines across both axes and 241 microseconds per operation on mixed slopes
  • Connected straight and sloped paths are now collected once during depowering instead of being scanned repeatedly
  • Cached powered-rail shape and power metadata and streamlined update-memo probing
  • Fixed search generations periodically losing reusable cached results
  • Benchmark results vary with hardware and server load

🛠 Improvements

  • Isolated update memos by world and thread, with atomic invalidation for safer operation when dimensions tick concurrently
  • Split rail traversal, lane updates, signal checks, and notifications into focused components without changing update behavior

🐞 Fixes

  • Fixed memoized unchanged updates potentially ignoring signal changes from trapped chests, jukeboxes, and other block-entity, analog-output, or direct-signal sources
  • Fixed memo entries being reused in another world at the same coordinates
  • Fixed stale or duplicate update-memo entries after block changes
  • Fixed packed search-cache metadata and generation edge cases that could disable reuse or misread cached state

⚠️ Snapshot Notes

  • This is a snapshot intended for testing before the final v2.0 release
  • Snapshot builds are only provided for selected Minecraft versions; all supported versions will be updated with the final release
  • There are no intentional gameplay behavior changes; the fixes restore vanilla parity in edge cases
2.0-snapshot-1Бета26.1.1, 26.1.2, 26.2 · 21 августа 2026 г.

RailOptimization v2.0-snapshot 1

This snapshot introduces the next-generation rail update engine — with state-changing updates 7-9x faster and unchanged updates up to 30x faster than vanilla.

🚀 Performance

  • State-changing updates (toggles): 7.5-9x faster than vanilla
  • Unchanged neighbor updates (repeated redstone pulses on an unchanged rail line): up to 30x faster
  • Long rail lines with powerLimit=64: about 12x faster than v1.6
  • Figures are statistical medians over 32 benchmark rounds on our test machine; real-world results vary with hardware and load

✨ New Features

Zero-Allocation Update Engine

  • Rebuilt the powered rail update pipeline on pooled, per-thread update contexts with no allocation in the mod's own hot paths
  • The rail search cache and update memo store their metadata in single bit-packed machine words, keeping the hot tables inside the L1 cache
  • Straight and ascending rail depowering share a single step-table path with no branching per rail

Memoized Unchanged Updates

  • Unchanged rails validate repeated neighbor updates against a memoized state and skip the rail line re-search entirely
  • Redstone clocks and repeated pulses no longer re-traverse the full powered rail chain when nothing changed

🛠 Improvements

  • Powered rail searches prune with the exact cached cost instead of re-walking known distances
  • Signal searches skip conductor directions already known to be invalid
  • Rail power limit values are clamped to the valid range

🐞 Fixes

  • Fixed out-of-range rail power limit values being stored as-is instead of being clamped

⚠️ Snapshot Notes

  • This is a snapshot intended for testing before the final v2.0 release
  • This release changes no observable rail or redstone behavior — it is a pure performance update, verified by the parity test suite
1.6Релиз1.20.6, 1.21, 1.21.1 · 24 июля 2026 г.

RailOptimization v1.6

RailOptimization v1.6 further reduces the cost of powered rail and activator rail updates, especially in frequently changing rail networks.

What's New

  • Added /railoptimization powerLimit <value> to change the powered/activator rail signal range from 1 to 64. The default remains 8 and changing it requires administrator permission.
  • /railoptimization now displays both the optimization state and the current power limit.

Improvements

  • Reworked rail traversal and search caching to avoid repeated path scans during the same update.
  • Replaced the per-update hash map with a compact cache designed for Minecraft's short rail signal paths.
  • Reused update contexts and mutable positions to reduce temporary allocations and garbage collection pressure.
  • Cached direct redstone power checks and improved the fast path for straight rail lines.

Fixes

  • Rail-shape lookup tables no longer rely on hard-coded enum ordinal ordering.
  • Rail-search cache entries are isolated between update phases to prevent unrelated search results from being reused.
1.6Релиз1.21.2, 1.21.3, 1.21.4 · 24 июля 2026 г.

RailOptimization v1.6

RailOptimization v1.6 further reduces the cost of powered rail and activator rail updates, especially in frequently changing rail networks.

What's New

  • Added /railoptimization powerLimit <value> to change the powered/activator rail signal range from 1 to 64. The default remains 8 and changing it requires administrator permission.
  • /railoptimization now displays both the optimization state and the current power limit.

Improvements

  • Reworked rail traversal and search caching to avoid repeated path scans during the same update.
  • Replaced the per-update hash map with a compact cache designed for Minecraft's short rail signal paths.
  • Reused update contexts and mutable positions to reduce temporary allocations and garbage collection pressure.
  • Cached direct redstone power checks and improved the fast path for straight rail lines.

Fixes

  • Rail-shape lookup tables no longer rely on hard-coded enum ordinal ordering.
  • Rail-search cache entries are isolated between update phases to prevent unrelated search results from being reused.
1.6Релиз1.21.8, 1.21.9, 1.21.10 · 24 июля 2026 г.

RailOptimization v1.6

RailOptimization v1.6 further reduces the cost of powered rail and activator rail updates, especially in frequently changing rail networks.

What's New

  • Added /railoptimization powerLimit <value> to change the powered/activator rail signal range from 1 to 64. The default remains 8 and changing it requires administrator permission.
  • /railoptimization now displays both the optimization state and the current power limit.

Improvements

  • Reworked rail traversal and search caching to avoid repeated path scans during the same update.
  • Replaced the per-update hash map with a compact cache designed for Minecraft's short rail signal paths.
  • Reused update contexts and mutable positions to reduce temporary allocations and garbage collection pressure.
  • Cached direct redstone power checks and improved the fast path for straight rail lines.

Fixes

  • Rail-shape lookup tables no longer rely on hard-coded enum ordinal ordering.
  • Rail-search cache entries are isolated between update phases to prevent unrelated search results from being reused.
1.6Релиз1.21.11 · 24 июля 2026 г.

RailOptimization v1.6

RailOptimization v1.6 further reduces the cost of powered rail and activator rail updates, especially in frequently changing rail networks.

What's New

  • Added /railoptimization powerLimit <value> to change the powered/activator rail signal range from 1 to 64. The default remains 8 and changing it requires administrator permission.
  • /railoptimization now displays both the optimization state and the current power limit.

Improvements

  • Reworked rail traversal and search caching to avoid repeated path scans during the same update.
  • Replaced the per-update hash map with a compact cache designed for Minecraft's short rail signal paths.
  • Reused update contexts and mutable positions to reduce temporary allocations and garbage collection pressure.
  • Cached direct redstone power checks and improved the fast path for straight rail lines.

Fixes

  • Rail-shape lookup tables no longer rely on hard-coded enum ordinal ordering.
  • Rail-search cache entries are isolated between update phases to prevent unrelated search results from being reused.
1.6Релиз26.1.1, 26.1.2, 26.2 · 24 июля 2026 г.

RailOptimization v1.6

RailOptimization v1.6 further reduces the cost of powered rail and activator rail updates, especially in frequently changing rail networks.

What's New

  • Added /railoptimization powerLimit <value> to change the powered/activator rail signal range from 1 to 64. The default remains 8 and changing it requires administrator permission.
  • /railoptimization now displays both the optimization state and the current power limit.

Improvements

  • Reworked rail traversal and search caching to avoid repeated path scans during the same update.
  • Replaced the per-update hash map with a compact cache designed for Minecraft's short rail signal paths.
  • Reused update contexts and mutable positions to reduce temporary allocations and garbage collection pressure.
  • Cached direct redstone power checks and improved the fast path for straight rail lines.

Fixes

  • Rail-shape lookup tables no longer rely on hard-coded enum ordinal ordering.
  • Rail-search cache entries are isolated between update phases to prevent unrelated search results from being reused.
1.5.1Релиз1.20.6, 1.21, 1.21.1 · 9 июля 2026 г.

RailOptimization v1.5.1

Fixed a crash that could happen during powered rail neighbor updates in Minecraft 1.20.x-1.21.1.

  • Fixed a null source position in rail update notifications
  • Improved compatibility with redstone-powered rail update chains

Note

Only v1.5 in 1.20-1.21.1 is affected, older versions work normally.

Комментарии

Загружаем…