> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/pinnaduels/reference/performance.md).

# Performance & Files

## Performance

* **Arenas:** each arena copy is pasted once, budgeted per tick (`arena.paste-ms-per-tick`), and kept. A duel only refills its two mines, after their chunks loaded in the background, within the same budget.
* **Score panel:** packet text and item displays, one set per viewer (about 20 entities). Frames are eased transformations sent with client interpolation, and a matrix or text is only sent when it changed.
* **Block breaks** are routed to their duel in O(1). **Tokens** are a synchronized counter bump on PinnaPrison's mining threads.
* **Ghosts:** the NPC's movement and swings are packets from an async ticker; only the recorded block breaks touch the world, on the main thread. Recordings are read and written on one IO thread; only their headers stay in memory.
* **Player data** (files) lives in memory (rankings, decay and seasons never touch the disk). It is read once in the background at startup. Once a minute only the players whose data changed are written, on the IO thread (temp file, then swapped in). Everything is flushed on shutdown.
* **Player data** (MySQL): only online players are in memory, read during the async login and saved on quit and once a minute (batched upserts on the IO thread). The ranking is a light list read every `ranking-refresh` seconds; no database call ever runs on the main thread. See [Storage](/p/pinnaduels/getting-started/storage.md).
* **Matchmaking:** the queue is sorted by ELO once a second and each player only checks players within its range.

## Files

```
plugins/PinnaDuels/
  config.yml, messages.yml
  arenas/<id>.yml            arena definitions (duelsmina.yml is the bundled one)
  schematics/<id>.pinna      arenas captured with /duel setup
  schematics/<id>.schem      WorldEdit schematics (duelsmina.schem is the bundled one)
  data/players.yml           everyone's duel data, storage.type yaml (an unreadable file is kept as players.yml.broken-<time>)
  data/season.yml            season number and start, storage.type yaml
  data/stash/                items set aside during a duel (given back on join after a crash)
  ghosts/*.ghost             recordings
plugins/PinnaPrison/guis/pinnaduels/*.yml   the menus
<world folder>/pinnaduels/pinnaduels-arenas.yml   which arena each copy holds
```

With `storage.type: mysql` the player data and the season are in the tables `<prefix>players` and `<prefix>data` instead; recordings, the item stash and everything else stay files.
