Performance Benchmarks
Core load checks оформлены как Go benchmarks, чтобы обычные unit tests оставались быстрыми.
В этом разделе
Другие страницы раздела:
Server Core Benchmarks
Используйте эти benchmarks, чтобы сравнивать runtime pressure, allocations и lock contention между изменениями.
benchmarks.sh
go test ./core/server -run ^$ -bench "Benchmark(WorldSetBlockParallel|GiveItemManyPlayersParallel|MoveAndDrainPlayerUpdatesParallel|JoinPlayersSequential)quot; -benchmem -benchtime=3s -count=3Сценарии
- BenchmarkWorldSetBlockParallel: параллельные server-owned block mutations через Server.SetBlock.
- BenchmarkGiveItemManyPlayersParallel: параллельные inventory service writes по многим online players.
- BenchmarkMoveAndDrainPlayerUpdatesParallel: player movement плюс outbox/view aggregation.
- BenchmarkJoinPlayersSequential: стоимость player/entity/view registration.
CPU And Lock Contention
Для scheduler и lock contention экспериментов отдельно гоняйте выбранные benchmarks по разным CPU counts.
cpu-benchmarks.sh
go test ./core/server -run ^$ -bench BenchmarkMoveAndDrainPlayerUpdatesParallel -benchmem -cpu 1,2,4,8,12