History

cleanup prof stats and trace context names

Andrew Meadows committed 8 years ago

Commit 406bf781 parent 25382049 files · +60 −49Browse files

Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all

Unified · Split

interface/src/Application.cpp+8−10
@@ -4846,8 +4846,7 @@ void Application::update(float deltaTime) { · 4845 unmodified lines
48464846 if (_physicsEnabled) {
48474847 {
48484848 PROFILE_RANGE(simulation_physics, "PreStep");
4849−
4850− PerformanceTimer perfTimer("updateStates)");
4849+ PerformanceTimer perfTimer("preStep)");
48514850 static VectorOfMotionStates motionStates;
48524851 _entitySimulation->getObjectsToRemoveFromPhysics(motionStates);
48534852 _physicsEngine->removeObjects(motionStates);
@@ -4880,22 +4879,22 @@ void Application::update(float deltaTime) { · 26 unmodified lines
48804879 }
48814880 {
48824881 PROFILE_RANGE(simulation_physics, "Step");
4883− PerformanceTimer perfTimer("stepSimulation");
4882+ PerformanceTimer perfTimer("step");
48844883 getEntities()->getTree()->withWriteLock([&] {
48854884 _physicsEngine->stepSimulation();
48864885 });
48874886 }
48884887 {
48894888 PROFILE_RANGE(simulation_physics, "PostStep");
4890− PerformanceTimer perfTimer("harvestChanges");
4889+ PerformanceTimer perfTimer("postStep");
48914890 if (_physicsEngine->hasOutgoingChanges()) {
48924891 // grab the collision events BEFORE handleOutgoingChanges() because at this point
48934892 // we have a better idea of which objects we own or should own.
48944893 auto& collisionEvents = _physicsEngine->getCollisionEvents();
48954894
48964895 getEntities()->getTree()->withWriteLock([&] {
4897− PROFILE_RANGE(simulation_physics, "Harvest");
4898− PerformanceTimer perfTimer("handleOutgoingChanges");
4896+ PROFILE_RANGE(simulation_physics, "HandleChanges");
4897+ PerformanceTimer perfTimer("handleChanges");
48994898
49004899 const VectorOfMotionStates& outgoingChanges = _physicsEngine->getChangedMotionStates();
49014900 _entitySimulation->handleChangedMotionStates(outgoingChanges);
@@ -4906,17 +4905,15 @@ void Application::update(float deltaTime) { · 4 unmodified lines
49064905 });
49074906
49084907 if (!_aboutToQuit) {
4909− // handleCollisionEvents() AFTER handleOutgoinChanges()
4908+ // handleCollisionEvents() AFTER handleOutgoingChanges()
49104909 {
49114910 PROFILE_RANGE(simulation_physics, "CollisionEvents");
4912− PerformanceTimer perfTimer("entities");
49134911 avatarManager->handleCollisionEvents(collisionEvents);
49144912 // Collision events (and their scripts) must not be handled when we're locked, above. (That would risk
49154913 // deadlock.)
49164914 _entitySimulation->handleCollisionEvents(collisionEvents);
49174915 }
49184916
4919− PROFILE_RANGE(simulation_physics, "UpdateEntities");
49204917 // NOTE: the getEntities()->update() call below will wait for lock
49214918 // and will simulate entity motion (the EntityTree has been given an EntitySimulation).
49224919 getEntities()->update(true); // update the models...
@@ -4927,7 +4924,8 @@ void Application::update(float deltaTime) { · 4 unmodified lines
49274924 myAvatar->harvestResultsFromPhysicsSimulation(deltaTime);
49284925 }
49294926
4930− if (Menu::getInstance()->isOptionChecked(MenuOption::DisplayDebugTimingDetails) &&
4927+ if (PerformanceTimer::isActive() &&
4928+ Menu::getInstance()->isOptionChecked(MenuOption::DisplayDebugTimingDetails) &&
49314929 Menu::getInstance()->isOptionChecked(MenuOption::ExpandPhysicsSimulationTiming)) {
49324930 _physicsEngine->harvestPerformanceStats();
49334931 }