Change some profiler values to microseconds

This commit is contained in:
sfan5 2024-04-20 15:11:25 +02:00
parent eb432d3da0
commit c8e46749a4
3 changed files with 7 additions and 9 deletions

View File

@ -122,7 +122,7 @@ void Sky::render()
if (!camera || !driver) if (!camera || !driver)
return; return;
ScopeProfiler sp(g_profiler, "Sky::render()", SPT_AVG); ScopeProfiler sp(g_profiler, "Sky::render()", SPT_AVG, PRECISION_MICRO);
// Draw perspective skybox // Draw perspective skybox

View File

@ -234,7 +234,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
Map *map = &env->getMap(); Map *map = &env->getMap();
ServerEnvironment *s_env = dynamic_cast<ServerEnvironment*>(env); ServerEnvironment *s_env = dynamic_cast<ServerEnvironment*>(env);
ScopeProfiler sp(g_profiler, PROFILER_NAME("collisionMoveSimple()"), SPT_AVG); ScopeProfiler sp(g_profiler, PROFILER_NAME("collisionMoveSimple()"), SPT_AVG, PRECISION_MICRO);
collisionMoveResult result; collisionMoveResult result;
@ -273,7 +273,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
std::vector<NearbyCollisionInfo> cinfo; std::vector<NearbyCollisionInfo> cinfo;
{ {
//TimeTaker tt2("collisionMoveSimple collect boxes"); //TimeTaker tt2("collisionMoveSimple collect boxes");
ScopeProfiler sp2(g_profiler, PROFILER_NAME("collision collect boxes"), SPT_AVG); ScopeProfiler sp2(g_profiler, PROFILER_NAME("collision collect boxes"), SPT_AVG, PRECISION_MICRO);
v3f minpos_f( v3f minpos_f(
MYMIN(pos_f->X, newpos_f.X), MYMIN(pos_f->X, newpos_f.X),

View File

@ -639,8 +639,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool
try { try {
std::istringstream is(*blob, std::ios_base::binary); std::istringstream is(*blob, std::ios_base::binary);
u8 version = SER_FMT_VER_INVALID; u8 version = readU8(is);
is.read((char*)&version, 1);
if(is.fail()) if(is.fail())
throw SerializationError("ServerMap::loadBlock(): Failed" throw SerializationError("ServerMap::loadBlock(): Failed"
@ -655,8 +654,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool
} }
{ {
ScopeProfiler sp(g_profiler, "ServerMap: deSer block", SPT_AVG); ScopeProfiler sp(g_profiler, "ServerMap: deSer block", SPT_AVG, PRECISION_MICRO);
// Read basic data
block->deSerialize(is, version, true); block->deSerialize(is, version, true);
} }
@ -699,7 +697,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); ScopeProfiler sp(g_profiler, "ServerMap: load block", SPT_AVG, PRECISION_MICRO);
bool created_new = (getBlockNoCreateNoEx(blockpos) == NULL); bool created_new = (getBlockNoCreateNoEx(blockpos) == NULL);
v2s16 p2d(blockpos.X, blockpos.Z); v2s16 p2d(blockpos.X, blockpos.Z);