davep avatar davep committed a309d4b

reapply 230c111ab816: Add some timers.

Comments (0)

Files changed (4)

indra/llcharacter/llcharacter.cpp

 //-----------------------------------------------------------------------------
 static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
 static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
+static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
 
 void LLCharacter::updateMotions(e_update_t update_type)
 {
 			mMotionController.unpauseAllMotions();
 		}
 		bool force_update = (update_type == FORCE_UPDATE);
-		mMotionController.updateMotions(force_update);
+		{
+			LLFastTimer t(FTM_UPDATE_MOTIONS);
+			mMotionController.updateMotions(force_update);
+		}
 	}
 }
 

indra/llcharacter/lleditingmotion.cpp

 	return TRUE;
 }
 
+static LLFastTimer::DeclareTimer FTM_EDITING_MOTION("Editing Motion");
+
 //-----------------------------------------------------------------------------
 // LLEditingMotion::onUpdate()
 //-----------------------------------------------------------------------------
 BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
 {
+	LLFastTimer t(FTM_EDITING_MOTION);
 	LLVector3 focus_pt;
 	LLVector3* pointAtPt = (LLVector3*)mCharacter->getAnimationData("PointAtPoint");
 

indra/llcharacter/llkeyframewalkmotion.cpp

 	return TRUE;
 }
 
+static LLFastTimer::DeclareTimer FTM_WALK_ADJUST_MOTION("Walk Adjust");
+
 //-----------------------------------------------------------------------------
 // LLWalkAdjustMotion::onUpdate()
 //-----------------------------------------------------------------------------
 BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
 {
+	LLFastTimer t(FTM_WALK_ADJUST_MOTION);
+
 	// delta_time is guaranteed to be non zero
 	F32 delta_time = llclamp(time - mLastTime, TIME_EPSILON, MAX_TIME_DELTA);
 	mLastTime = time;

indra/llcharacter/llmotioncontroller.cpp

 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS_BY_TYPE("Update Motions By Type");
+
 //-----------------------------------------------------------------------------
 // updateMotionsByType()
 //-----------------------------------------------------------------------------
 void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
 {
+	LLFastTimer t(FTM_UPDATE_MOTIONS_BY_TYPE);
 	BOOL update_result = TRUE;
 	U8 last_joint_signature[LL_CHARACTER_MAX_JOINTS];
 
 // call updateMotion() or updateMotionsMinimal() every frame
 //-----------------------------------------------------------------------------
 
+static LLFastTimer::DeclareTimer FTM_UPDATE_MOTION_PURGE_EXCESS("Purge Excess Motions");
+static LLFastTimer::DeclareTimer FTM_UPDATE_LOADING_MOTIONS("Update Loading Motions");
+
 //-----------------------------------------------------------------------------
 // updateMotion()
 //-----------------------------------------------------------------------------
 	mPrevTimerElapsed = cur_time;
 	mLastTime = mAnimTime;
 
-	// Always cap the number of loaded motions
-	purgeExcessMotions();
+	{
+		LLFastTimer t(FTM_UPDATE_MOTION_PURGE_EXCESS);
+		// Always cap the number of loaded motions
+		purgeExcessMotions();
+	}
 	
 	// Update timing info for this time step.
 	if (!mPaused)
 					mLastInterp = interp;
 				}
 
-				updateLoadingMotions();
+				{
+					LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
+					updateLoadingMotions();
+				}
+
 				return;
 			}
 			
 		}
 	}
 
-	updateLoadingMotions();
+	{
+		LLFastTimer t(FTM_UPDATE_LOADING_MOTIONS);
+		updateLoadingMotions();
+	}
 
 	resetJointSignatures();
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.