diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 22:39:35 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 22:39:35 +0300 |
commit | 2419d0029ac36952aaa74b685d529a3592adb6aa (patch) | |
tree | eb0c1fa1aa1167611e72d83f69bf16cf466a8466 /src/environment.cpp | |
parent | b8f2dcea4de03b21f353240935a3295f237f258f (diff) | |
download | minetest-2419d0029ac36952aaa74b685d529a3592adb6aa.tar.gz minetest-2419d0029ac36952aaa74b685d529a3592adb6aa.tar.bz2 minetest-2419d0029ac36952aaa74b685d529a3592adb6aa.zip |
Some more profiler stuff to get the hang on what really uses CPU
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 99dc6d62b..47743bfc7 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -684,7 +684,7 @@ void ServerEnvironment::step(float dtime) Handle players */ { - ScopeProfiler sp(g_profiler, "SEnv: handle players avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: handle players avg", SPT_AVG); for(core::list<Player*>::Iterator i = m_players.begin(); i != m_players.end(); i++) { @@ -726,7 +726,7 @@ void ServerEnvironment::step(float dtime) */ if(m_active_blocks_management_interval.step(dtime, 2.0)) { - ScopeProfiler sp(g_profiler, "SEnv: manage act. block list avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: manage act. block list avg /2s", SPT_AVG); /* Get player block positions */ @@ -803,7 +803,7 @@ void ServerEnvironment::step(float dtime) */ if(m_active_blocks_nodemetadata_interval.step(dtime, 1.0)) { - ScopeProfiler sp(g_profiler, "SEnv: mess in act. blocks avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: mess in act. blocks avg /1s", SPT_AVG); float dtime = 1.0; @@ -842,7 +842,7 @@ void ServerEnvironment::step(float dtime) if(m_active_blocks_test_interval.step(dtime, 10.0)) { - ScopeProfiler sp(g_profiler, "SEnv: modify in blocks avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: modify in blocks avg /10s", SPT_AVG); //float dtime = 10.0; for(core::map<v3s16, bool>::Iterator @@ -1045,8 +1045,10 @@ void ServerEnvironment::step(float dtime) Step active objects */ { - ScopeProfiler sp(g_profiler, "SEnv: step act. objs avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: step act. objs avg", SPT_AVG); //TimeTaker timer("Step active objects"); + + g_profiler->avg("SEnv: num of objects", m_active_objects.size()); // This helps the objects to send data at the same time bool send_recommended = false; @@ -1086,7 +1088,7 @@ void ServerEnvironment::step(float dtime) */ if(m_object_management_interval.step(dtime, 0.5)) { - ScopeProfiler sp(g_profiler, "SEnv: remove removed objs avg", SPT_LOWPASS); + ScopeProfiler sp(g_profiler, "SEnv: remove removed objs avg /.5s", SPT_AVG); /* Remove objects that satisfy (m_removed && m_known_by_count==0) */ |