DOCS berries.games ↗

Speed & performance

BerryHomes is built so your server never waits for it.

How it's light

  • Homes load while the player is logging in, on the login thread, before they've even joined. By the time they type /home, everything is in memory. Nothing on the server thread ever waits for the database.
  • Saves are batched. Setting, moving or editing a home updates memory straight away and queues the write; queued writes go to the database together, within 50 ms, in one transaction.
  • Menus are cheap to open. Items are built once and reused until something they show changes (the home moves, the minute in "3m ago" ticks over). Re-opening a menu mostly reuses finished items.
  • Messages are parsed once and reused. A countdown or menu line costs a lookup, not a full parse, even when the numbers in it change.
  • No per-tick tasks. Warmups react to the move and damage events and only update once a second.
  • Safety checks read a few blocks in chunks that are already loaded, and only load the chunk when it isn't.
  • Cross-server uses one small database row per teleport, taken exactly once by the server the player lands on. Redis, if you use it, only carries short "this player's homes changed" notes.
  • Folia: everything runs on the right region's or player's thread.

Measured

Real Minecraft clients (bots) on a 4-core Intel Xeon 2.1 GHz test machine, 2 GB per server, Paper 1.21.8, measured with spark.

Spam test: 50 players, each with 20 homes, doing something every 250 ms for a minute (/home, opening /homes, /sethome, tab-completing). 10,600 actions cost BerryHomes 1,360 ms of server-thread time: 0.13 ms per action. Tick time averaged 11.7 ms, with no lag warnings.

Join wave: 50 players joining at once, 1,000 homes between them: no measurable server-thread time. The homes loaded on the login thread (72 ms in total).

Cross-server: 10 players bouncing between two servers behind Velocity for a minute: 402 cross-server teleports, all landed on their home. 301 ms median from command to arrival, and BerryHomes used 0.24% of each server's thread.

Tuning

There's nothing you need to tune. If you run MySQL far away from your servers, keep pool-size at 3–4; batched writes mean more connections don't help.