mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Instrument touchMapBlocks and block loading/deserialization. (#13314)
This commit is contained in:
parent
f1feeb319c
commit
8f25f487fe
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user