Minecraft anticheat guide

How FairPlay Approaches Anticheat Performance Engineering

How FairPlay profiles hot paths, keeps correctness barriers synchronous, and states benchmark scope so owners read its performance claims correctly.

Short answer: how FairPlay approaches performance

Per FairPlay engineering notes, performance work starts with a profiler, changes one hot method at a time, and keeps correctness barriers intact. The 4.0.7 audits kept behavior the same, rejected several asynchronous rewrites, and reported microbenchmarks of single methods. Those figures do not measure whole-server CPU or TPS.

Start with a profiler, not a guess

The notes describe one case where a profiler pointed at chunk unload handling. Each unloaded chunk triggered a scan of every cached occlusion cell, even when the chunk had no cached entries. The fix changed the cost of that event, not the rule it enforced.

The audit also reviewed packet-facing indexing, snapshots, click statistics and world lookups. Changes were limited to paths where the old and new code could be compared directly.

Keep correctness barriers synchronous

A slow invalidation can be tempting to move off the event thread. The notes reject that move for chunk unloads. Between the event callback and a worker thread, stale occlusion snapshots could still be read, and a queue adds lifecycle work.

The chosen approach records a revision fence under the cache's existing lock. Normal unload events cost constant time, and cached data captured before the unload cannot be used after it. The notes accept a tradeoff: under extreme chunk churn, more lookups may return an unknown result, which is safer than stale authority.

Read the measurements with their scope

The figures below were measured in FairPlay's own test setup, not your server. They time individual methods in standalone Java processes, with no Minecraft server, Paper or Folia scheduler involved.

The chunk-unload row comes from an isolated cache harness with a synthetic population of cached cells. The notes say the speedup varies with cache occupancy, hardware and real workloads, so it is a direction, not a forecast for your network.

Measured in FairPlay's own test setup, not your server
ChangeScope in the notesResult
Recent block-change history, 100,000 recordsStandalone Java process, OpenJDK 21, classes compiled to Java 8, three runs per versionMedian 155.027 ms to 36.420 ms (76.5% less)
Maximum click intensity, 300,000 queriesSame process setup as above, fixed-size click historyMedian 180.419 ms to 48.978 ms (72.9% less)
Chunk-unload invalidation, 300 calls against 40,000 cached cellsIsolated standalone JVM, described in the notes as illustrative104.536 ms to 0.523 ms

Turn method timings into server impact

A faster method only matters in proportion to how much CPU it uses on your server. The notes give this formula: server CPU saved equals the sum, across changed methods, of each method's share of server CPU multiplied by the fraction of that method's time saved.

For example, a method that uses 2% of server CPU and drops by 75% saves about 1.5 percentage points. That number is hypothetical. The notes say the real share needs a profile taken after the change, and rarely used paths may save almost nothing.

Reject changes that trade away correctness

The notes list candidates that were reviewed and not changed. Each one would have traded a measurable gain for a risk the team could not test in the current environment.

Refresh less, but precisely

The 4.1.0 snapshot notes describe the same discipline. Periodic combat refreshes were narrowed, and selected-slot changes now force a fresh read before range checks use the value. The notes name the risk: an unselected slot can stay cached until it is selected.

The same notes call a profiler-based reduction target for that work aspirational. The target was not reproduced, and the notes say so.

Measure the change on your own server

Use the same scenario before and after an update. Compare similar player counts, packet rates and chunk-change activity.

FAQ

Do these benchmark numbers show what my server will gain?

No. They time single methods in standalone processes. Server-wide gain depends on each method's share of your CPU, which only a profile on your server can show.

Did FairPlay measure a server-wide TPS gain?

The notes do not claim one. They state that no live Folia run or server CPU profile was executed for the audited changes.

Why does FairPlay avoid moving work to async threads?

Where a correctness barrier must apply immediately, an asynchronous worker can let stale data be read between the event and the cleanup. The notes prefer a synchronous fence with constant-time cost.

Were these changes tested on a live Minecraft server?

The notes say no. Full Maven and JUnit runs and live Paper or Folia tests were not executed in that environment. The evidence comes from standalone harnesses, source guards and deterministic call-count checks.

Can a performance change affect detection?

The 4.0.7 audit states that it changed no thresholds, packet ordering or cancellation. Cache refresh changes in later notes carry their own stated risks, so test them on staging.

Related sources and official pages

Browse all anticheat guides