diff --git a/src/logic/ChunksController.cpp b/src/logic/ChunksController.cpp index b521b0d8..692d8705 100644 --- a/src/logic/ChunksController.cpp +++ b/src/logic/ChunksController.cpp @@ -163,7 +163,11 @@ bool ChunksController::buildLights( return false; } +#include "util/timeutil.hpp" + void ChunksController::createChunk(const Player& player, int x, int z) const { + timeutil::ScopeLogTimer log(111); + if (!player.isLoadingChunks()) { if (auto chunk = level.chunks->fetch(x, z)) { player.chunks->putChunk(chunk); diff --git a/src/voxels/GlobalChunks.cpp b/src/voxels/GlobalChunks.cpp index 66da7792..830e13d6 100644 --- a/src/voxels/GlobalChunks.cpp +++ b/src/voxels/GlobalChunks.cpp @@ -89,13 +89,19 @@ static inline auto load_inventories( return invs; } +#include "util/timeutil.hpp" + std::shared_ptr GlobalChunks::create(int x, int z) { const auto& found = chunksMap.find(keyfrom(x, z)); if (found != chunksMap.end()) { return found->second; } - auto chunk = std::make_shared(x, z); + std::shared_ptr chunk; + { + timeutil::ScopeLogTimer log(555); + chunk = std::make_shared(x, z); + } chunksMap[keyfrom(x, z)] = chunk; World& world = *level.getWorld();