Fast Events: Speed Up Minecraft Forge and NeoForge Event Buses

Download Fast Events for Minecraft to cut event bus overhead on Forge 1.20.1 and NeoForge 1.21.1. No config, no dependencies, just faster ticks.

Fast Events

If you run a big modpack, you have probably blamed your CPU, your RAM, or that one entity-heavy mod for your tick times. Sometimes the real culprit is quieter than that: the event bus itself. Fast Events is a drop-in jar that makes the Forge and NeoForge event bus dramatically faster, and it does it without touching a single line of any other mod's code.

What Fast Events Actually Does

Both Forge and NeoForge dispatch events through a single call site that sees every listener class in the game. That makes the call megamorphic: the JIT cannot inline any listener, so every invocation pays a virtual dispatch plus wrapper overhead. On a large pack, most of your per-tick event cost is exactly this overhead, not your actual listener logic.

Fast Events replaces that loop with a generated dispatcher per call site. The first time a post site fires for an event class, a dispatcher is built for that class's listener array, with one field and one call instruction per listener. Each call site then sees a single receiver type and inlines all the way down into the listener body.

Two extra wins come along for free. If an event class has no listeners, the new event object at the call site is short-circuited and never constructed. And dispatchers are rebuilt when a listener array changes, so listeners registered late still take effect.

Benchmarks: The Numbers That Matter

Measured in nanoseconds per post, single thread, Java 21, using the repository's own benchmark harness. Lower is better.

  • Minecraft 1.20.1 / Forge 47.4, @SubscribeEvent listeners: 49.6 ns vanilla vs 9.3 ns with Fast Events (5.3x faster)
  • addListener with eight different refs: 46.4 ns vs 8.2 ns (5.7x faster)
  • Generic listeners, AttachCapabilitiesEvent style: 52.2 ns vs 12.4 ns (4.2x faster)
  • 128 listeners on one class: 201 ns vs 88 ns (2.3x faster)
  • Minecraft 1.21.1 / NeoForge 21.1, @SubscribeEvent listeners: 31.2 ns vs 8.8 ns (3.5x faster)
  • Escaped event with no listeners at all: about 2.4 ns

Wider listener arrays are the common case in real packs, and they stay ahead of vanilla too. Absolute savings scale with how often a pack posts events, which is thousands of times per tick on a busy server.

Supported Versions and Loaders

Fast Events ships one jar per game version, and nothing else is required:

  • Minecraft 1.20.1 with Forge 47.x (event bus 6.0.x / 6.2.x): use fastevents-1.20-*.jar
  • Minecraft 1.21.1 with NeoForge 21.1.x (event bus 8.0.x): use fastevents-1.21-*.jar

Other 1.20.x and 1.21.x builds are not supported. There is no Mixin, no access transformer, and no coremod entry point for other performance mods to fight over. It is a launch plugin that only replaces post and addListener call sites, leaving Forge, NeoForge, and the event bus classes themselves untouched.

How to Install Fast Events for Minecraft

Setup takes about a minute. Here is how to install it on a client or a server:

  • Install Minecraft 1.20.1 with Forge 47.x, or Minecraft 1.21.1 with NeoForge 21.1.x.
  • Download Fast Events and pick the jar that matches your game version.
  • Drop the jar into your mods/ folder. It also works on the launcher classpath.
  • Launch the game. No config file, no dependencies, nothing to set up.

Client and server are both supported and both sides benefit. On a server, install it on the server; clients that join do not need it, though they get a small gain if they have it too. If you would rather skip manual file shuffling, the foxygame.net launcher handles the whole job: its add-on catalog lets you install Fast Events in one click and keeps it updated automatically whenever you switch between supported game versions.

Semantics Stay Exactly the Same

Speed means nothing if behavior changes, so the generated dispatcher is a straight-line expansion of what the bus would have done. Priority order, phase markers, cancellation, generic type filters, and exception handling all behave as in vanilla. Listeners are visited in the same priority-sorted array order, and cancellation is checked at the same points. Mods that rely on ordering or early-out after cancellation behave identically.

Fast Events is also safe to remove at any time, since nothing is written to your world or configs. It does not patch event classes, so observability and optimizer mods that touch the bus are unaffected. If another mod also replaces post call sites, both end up wrapping the same site; the result is still correct, just with one extra indirection.

Optional Debug Settings

These system properties exist for troubleshooting only; the default configuration is what you want for playing.

  • -Dfastevents.guard=false disables the skip-new-event shortcut.
  • -Dfastevents.audit=true verifies the cached listener array on every post and logs late registrations.
  • -Dfastevents.diag=true (1.20.1 only) logs listeners registered through a path that is not rewritten.

Who Should Use It

Fast Events helps in proportion to how much event traffic you have. A kitchen-sink 1.20.1 pack sees the biggest gain, but even a nearly vanilla instance gains a little because vanilla itself posts events every tick. Modpacks are exactly the case where the saving matters, since the number of listeners per event class grows with the mod count. If your ticks feel heavier than your hardware suggests, this is one of the cheapest performance upgrades you can make.

===ARTICLE===