Add conditional LLFastTimer blocks to stallable main thread methods

Wed, 28 Aug 2013 18:55:29 -0400

author
Monty Brandenberg <monty@lindenlab.com>
date
Wed, 28 Aug 2013 18:55:29 -0400
changeset 40717
461a27e3b944
parent 40716
8d3faebc1328
child 40718
1248eee75671

Add conditional LLFastTimer blocks to stallable main thread methods

indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llmeshrepository.cpp	Mon Aug 26 17:53:30 2013 -0400
     1.2 +++ b/indra/newview/llmeshrepository.cpp	Wed Aug 28 18:55:29 2013 -0400
     1.3 @@ -67,6 +67,7 @@
     1.4  #include "llfoldertype.h"
     1.5  #include "llviewerparcelmgr.h"
     1.6  #include "lluploadfloaterobservers.h"
     1.7 +#include "llfasttimer.h"
     1.8  
     1.9  #include "boost/lexical_cast.hpp"
    1.10  
    1.11 @@ -125,6 +126,16 @@
    1.12  static boost::signals2::connection metrics_teleport_connection;
    1.13  static unsigned int metrics_teleport_start_count(0);
    1.14  static void metrics_teleport_started();
    1.15 +static LLFastTimer::DeclareTimer FTM_MESH_FETCH("Mesh Fetch");
    1.16 +
    1.17 +// Enable here or in build environment to get fasttimer data on mesh fetches.
    1.18 +#define LL_FASTTIMER_MESH_ENABLE		1
    1.19 +#if LL_FASTTIMER_MESH_ENABLE
    1.20 +#define	MESH_FASTTIMER_DEFBLOCK			LLFastTimer meshtimer(FTM_MESH_FETCH)
    1.21 +#else
    1.22 +#define	MESH_FASTTIMER_DEFBLOCK
    1.23 +#endif // LL_FASTTIMER_MESH_ENABLE
    1.24 + 
    1.25  
    1.26  //get the number of bytes resident in memory for given volume
    1.27  U32 get_volume_memory_size(const LLVolume* volume)
    1.28 @@ -2403,6 +2414,8 @@
    1.29  
    1.30  S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod)
    1.31  {
    1.32 +	MESH_FASTTIMER_DEFBLOCK;
    1.33 +	
    1.34  	// Manage time-to-load metrics for mesh download operations.
    1.35  	metricsProgress(1);
    1.36  
    1.37 @@ -2484,6 +2497,7 @@
    1.38  
    1.39  void LLMeshRepository::notifyLoadedMeshes()
    1.40  { //called from main thread
    1.41 +	MESH_FASTTIMER_DEFBLOCK;
    1.42  
    1.43  	LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("MeshMaxConcurrentRequests");
    1.44  
    1.45 @@ -2791,6 +2805,8 @@
    1.46  
    1.47  const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj)
    1.48  {
    1.49 +	MESH_FASTTIMER_DEFBLOCK;
    1.50 +
    1.51  	if (mesh_id.notNull())
    1.52  	{
    1.53  		skin_map::iterator iter = mSkinMap.find(mesh_id);
    1.54 @@ -2817,6 +2833,8 @@
    1.55  
    1.56  void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id)
    1.57  {
    1.58 +	MESH_FASTTIMER_DEFBLOCK;
    1.59 +
    1.60  	if (mesh_id.notNull())
    1.61  	{
    1.62  		LLModel::Decomposition* decomp = NULL;
    1.63 @@ -2844,6 +2862,8 @@
    1.64  
    1.65  LLModel::Decomposition* LLMeshRepository::getDecomposition(const LLUUID& mesh_id)
    1.66  {
    1.67 +	MESH_FASTTIMER_DEFBLOCK;
    1.68 +
    1.69  	LLModel::Decomposition* ret = NULL;
    1.70  
    1.71  	if (mesh_id.notNull())
    1.72 @@ -2906,6 +2926,8 @@
    1.73  
    1.74  LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
    1.75  {
    1.76 +	MESH_FASTTIMER_DEFBLOCK;
    1.77 +
    1.78  	return mThread->getMeshHeader(mesh_id);
    1.79  }
    1.80  

mercurial