History

Adding the function source when profiling, to explore perf issues

samcake committed 9 years ago

Commit bda52c31 parent 86b23821 file · +3 −1Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+3−1
@@ -1284,7 +1284,8 @@ void ScriptEngine::timerFired() { · 1283 unmodified lines
12841284
12851285 // call the associated JS function, if it exists
12861286 if (timerData.function.isValid()) {
1287− PROFILE_RANGE(script, __FUNCTION__);
1287+ //PROFILE_RANGE(script, __FUNCTION__);
1288+ PROFILE_RANGE(script, timerData.function.toString().toStdString().c_str());
12881289 auto preTimer = p_high_resolution_clock::now();
12891290 callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList());
12901291 auto postTimer = p_high_resolution_clock::now();
@@ -1311,6 +1312,7 @@ QObject* ScriptEngine::setupTimerWithInterval(const QScriptValue& function, int · 20 unmodified lines
13111312 // make sure the timer stops when the script does
13121313 connect(this, &ScriptEngine::scriptEnding, newTimer, &QTimer::stop);
13131314
1315+
13141316 CallbackData timerData = { function, currentEntityIdentifier, currentSandboxURL };
13151317 _timerFunctionMap.insert(newTimer, timerData);
13161318