63 private static array $aggregators = [];
65 private static function newTimer(
string $worldName,
string $timerName) :
TimingsHandler{
66 $aggregator = self::$aggregators[$timerName] ??=
new TimingsHandler(
"Worlds - $timerName");
71 public function __construct(
World $world){
74 $this->setBlock = self::newTimer($name,
"Set Blocks");
75 $this->doBlockLightUpdates = self::newTimer($name,
"Block Light Updates");
76 $this->doBlockSkyLightUpdates = self::newTimer($name,
"Sky Light Updates");
78 $this->doChunkUnload = self::newTimer($name,
"Unload Chunks");
79 $this->scheduledBlockUpdates = self::newTimer($name,
"Scheduled Block Updates");
80 $this->neighbourBlockUpdates = self::newTimer($name,
"Neighbour Block Updates");
81 $this->randomChunkUpdates = self::newTimer($name,
"Random Chunk Updates");
82 $this->randomChunkUpdatesChunkSelection = self::newTimer($name,
"Random Chunk Updates - Chunk Selection");
83 $this->doChunkGC = self::newTimer($name,
"Garbage Collection");
84 $this->entityTick = self::newTimer($name,
"Entity Tick");
85 $this->tileTick = self::newTimer($name,
"Block Entity Tick");
86 $this->doTick = self::newTimer($name,
"World Tick");
88 $this->syncChunkSend = self::newTimer($name,
"Player Send Chunks");
89 $this->syncChunkSendPrepare = self::newTimer($name,
"Player Send Chunk Prepare");
91 $this->syncChunkLoad = self::newTimer($name,
"Chunk Load");
92 $this->syncChunkLoadData = self::newTimer($name,
"Chunk Load - Data");
93 $this->syncChunkLoadFixInvalidBlocks = self::newTimer($name,
"Chunk Load - Fix Invalid Blocks");
94 $this->syncChunkLoadEntities = self::newTimer($name,
"Chunk Load - Entities");
95 $this->syncChunkLoadTileEntities = self::newTimer($name,
"Chunk Load - Block Entities");
97 $this->syncDataSave = self::newTimer($name,
"Data Save");
98 $this->syncChunkSave = self::newTimer($name,
"Chunk Save");
100 $this->chunkPopulationOrder = self::newTimer($name,
"Chunk Population - Order");
101 $this->chunkPopulationCompletion = self::newTimer($name,
"Chunk Population - Completion");