summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2013-08-28 18:55:29 -0400
committerMonty Brandenberg <monty@lindenlab.com>2013-08-28 18:55:29 -0400
commit42e3d55fb2d0579b968ff8df20e9a814229b3e72 (patch)
tree8b4a302eb8330bdca952a2c5f2dd8d83a3480eca /indra/newview/llmeshrepository.cpp
parent07c145ad4023593c38ef2d3f07a60a2875f474dd (diff)
Add conditional LLFastTimer blocks to stallable main thread methods
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rwxr-xr-xindra/newview/llmeshrepository.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 6dc834e852..0599fcfd2d 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -67,6 +67,7 @@
#include "llfoldertype.h"
#include "llviewerparcelmgr.h"
#include "lluploadfloaterobservers.h"
+#include "llfasttimer.h"
#include "boost/lexical_cast.hpp"
@@ -125,6 +126,16 @@ static bool metrics_inited(false);
static boost::signals2::connection metrics_teleport_connection;
static unsigned int metrics_teleport_start_count(0);
static void metrics_teleport_started();
+static LLFastTimer::DeclareTimer FTM_MESH_FETCH("Mesh Fetch");
+
+// Enable here or in build environment to get fasttimer data on mesh fetches.
+#define LL_FASTTIMER_MESH_ENABLE 1
+#if LL_FASTTIMER_MESH_ENABLE
+#define MESH_FASTTIMER_DEFBLOCK LLFastTimer meshtimer(FTM_MESH_FETCH)
+#else
+#define MESH_FASTTIMER_DEFBLOCK
+#endif // LL_FASTTIMER_MESH_ENABLE
+
//get the number of bytes resident in memory for given volume
U32 get_volume_memory_size(const LLVolume* volume)
@@ -2403,6 +2414,8 @@ S32 LLMeshRepository::update()
S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod)
{
+ MESH_FASTTIMER_DEFBLOCK;
+
// Manage time-to-load metrics for mesh download operations.
metricsProgress(1);
@@ -2484,6 +2497,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
void LLMeshRepository::notifyLoadedMeshes()
{ //called from main thread
+ MESH_FASTTIMER_DEFBLOCK;
LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("MeshMaxConcurrentRequests");
@@ -2791,6 +2805,8 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo
const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj)
{
+ MESH_FASTTIMER_DEFBLOCK;
+
if (mesh_id.notNull())
{
skin_map::iterator iter = mSkinMap.find(mesh_id);
@@ -2817,6 +2833,8 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const
void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id)
{
+ MESH_FASTTIMER_DEFBLOCK;
+
if (mesh_id.notNull())
{
LLModel::Decomposition* decomp = NULL;
@@ -2844,6 +2862,8 @@ void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id)
LLModel::Decomposition* LLMeshRepository::getDecomposition(const LLUUID& mesh_id)
{
+ MESH_FASTTIMER_DEFBLOCK;
+
LLModel::Decomposition* ret = NULL;
if (mesh_id.notNull())
@@ -2906,6 +2926,8 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
{
+ MESH_FASTTIMER_DEFBLOCK;
+
return mThread->getMeshHeader(mesh_id);
}