Instrument touchMapBlocks and block loading/deserialization. (#13314)

This commit is contained in:
lhofhansl 2023-06-19 16:59:08 -07:00 committed by GitHub
parent f1feeb319c
commit 8f25f487fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

@ -623,6 +623,8 @@ void ClientMap::touchMapBlocks()
if (m_control.range_all || m_loops_occlusion_culler) if (m_control.range_all || m_loops_occlusion_culler)
return; return;
ScopeProfiler sp(g_profiler, "CM::touchMapBlocks()", SPT_AVG);
v3s16 cam_pos_nodes = floatToInt(m_camera_position, BS); v3s16 cam_pos_nodes = floatToInt(m_camera_position, BS);
v3s16 p_blocks_min; v3s16 p_blocks_min;

@ -1803,8 +1803,11 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool
block = block_created_new.get(); block = block_created_new.get();
} }
{
ScopeProfiler sp(g_profiler, "ServerMap: deSer block", SPT_AVG);
// Read basic data // Read basic data
block->deSerialize(is, version, true); block->deSerialize(is, version, true);
}
// If it's a new block, insert it to the map // If it's a new block, insert it to the map
if (block_created_new) { if (block_created_new) {
@ -1845,6 +1848,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool
MapBlock* ServerMap::loadBlock(v3s16 blockpos) MapBlock* ServerMap::loadBlock(v3s16 blockpos)
{ {
ScopeProfiler sp(g_profiler, "ServerMap: load block", SPT_AVG);
bool created_new = (getBlockNoCreateNoEx(blockpos) == NULL); bool created_new = (getBlockNoCreateNoEx(blockpos) == NULL);
v2s16 p2d(blockpos.X, blockpos.Z); v2s16 p2d(blockpos.X, blockpos.Z);