diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-07 21:54:18 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-07 21:54:18 +0200 |
commit | 11716825fcf219349a7a3952e75688d167318714 (patch) | |
tree | 7d0a84d973937e39accb9ad48039b6277cdad3e8 /src | |
parent | 0309021359ab74e6c7bea2fd983df1780fd9a4bc (diff) | |
download | minetest-11716825fcf219349a7a3952e75688d167318714.tar.gz minetest-11716825fcf219349a7a3952e75688d167318714.tar.bz2 minetest-11716825fcf219349a7a3952e75688d167318714.zip |
Move profiler measurements into inside of mutex locking for more useful results
Diffstat (limited to 'src')
-rw-r--r-- | src/server.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server.cpp b/src/server.cpp index 97fafd2c2..2facb1469 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1108,7 +1108,6 @@ void Server::AsyncRunStep() } { - ScopeProfiler sp(g_profiler, "Server: sel and send blocks to clients"); // Send blocks to clients SendBlocks(dtime); } @@ -1788,6 +1787,7 @@ void Server::AsyncRunStep() if(counter >= g_settings->getFloat("server_map_save_interval")) { counter = 0.0; + JMutexAutoLock lock(m_env_mutex); ScopeProfiler sp(g_profiler, "Server: saving stuff"); @@ -1795,13 +1795,10 @@ void Server::AsyncRunStep() if(m_authmanager.isModified()) m_authmanager.save(); - //Bann stuff + //Ban stuff if(m_banmanager.isModified()) m_banmanager.save(); - // Map - JMutexAutoLock lock(m_env_mutex); - // Save changed parts of map m_env->getMap().save(MOD_STATE_WRITE_NEEDED); @@ -1862,6 +1859,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) JMutexAutoLock envlock(m_env_mutex); JMutexAutoLock conlock(m_con_mutex); + ScopeProfiler sp(g_profiler, "Server::ProcessData"); + try{ Address address = m_con.GetPeerAddress(peer_id); @@ -3661,7 +3660,7 @@ void Server::SendBlocks(float dtime) JMutexAutoLock envlock(m_env_mutex); JMutexAutoLock conlock(m_con_mutex); - //TimeTaker timer("Server::SendBlocks"); + ScopeProfiler sp(g_profiler, "Server: sel and send blocks to clients"); core::array<PrioritySortedBlockTransfer> queue; |