mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
clean up
This commit is contained in:
parent
b7b520a6e8
commit
c0e8b6c8bc
3 changed files with 18 additions and 9 deletions
|
@ -1283,7 +1283,6 @@ void ScriptEngine::timerFired() {
|
|||
// call the associated JS function, if it exists
|
||||
if (timerData.function.isValid()) {
|
||||
PROFILE_RANGE(script, __FUNCTION__);
|
||||
// PROFILE_RANGE(script, timerData.function.toString().toStdString().c_str());
|
||||
auto preTimer = p_high_resolution_clock::now();
|
||||
callWithEnvironment(timerData.definingEntityIdentifier, timerData.definingSandboxURL, timerData.function, timerData.function, QScriptValueList());
|
||||
auto postTimer = p_high_resolution_clock::now();
|
||||
|
@ -1396,15 +1395,11 @@ void ScriptEngine::print(const QString& message) {
|
|||
|
||||
|
||||
void ScriptEngine::beginProfileRange(const QString& label) const {
|
||||
if (trace_script().isDebugEnabled()) {
|
||||
tracing::traceEvent(trace_script(), label.toStdString().c_str(), tracing::DurationBegin);
|
||||
}
|
||||
PROFILE_SYNC_BEGIN(script, label.toStdString().c_str(), label.toStdString().c_str());
|
||||
}
|
||||
|
||||
void ScriptEngine::endProfileRange(const QString& label) const {
|
||||
if (trace_script().isDebugEnabled()) {
|
||||
tracing::traceEvent(trace_script(), label.toStdString().c_str(), tracing::DurationEnd);
|
||||
}
|
||||
PROFILE_SYNC_END(script, label.toStdString().c_str(), label.toStdString().c_str());
|
||||
}
|
||||
|
||||
// Script.require.resolve -- like resolvePath, but performs more validation and throws exceptions on invalid module identifiers (for consistency with Node.js)
|
||||
|
|
|
@ -46,6 +46,20 @@ private:
|
|||
const QLoggingCategory& _category;
|
||||
};
|
||||
|
||||
|
||||
inline void syncBegin(const QLoggingCategory& category, const QString& name, const QString& id, const QVariantMap& args = QVariantMap(), const QVariantMap& extra = QVariantMap()) {
|
||||
if (category.isDebugEnabled()) {
|
||||
tracing::traceEvent(category, name, tracing::DurationBegin, id, args, extra);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void syncEnd(const QLoggingCategory& category, const QString& name, const QString& id, const QVariantMap& args = QVariantMap(), const QVariantMap& extra = QVariantMap()) {
|
||||
if (category.isDebugEnabled()) {
|
||||
tracing::traceEvent(category, name, tracing::DurationEnd, id, args, extra);
|
||||
}
|
||||
}
|
||||
|
||||
inline void asyncBegin(const QLoggingCategory& category, const QString& name, const QString& id, const QVariantMap& args = QVariantMap(), const QVariantMap& extra = QVariantMap()) {
|
||||
if (category.isDebugEnabled()) {
|
||||
tracing::traceEvent(category, name, tracing::AsyncNestableStart, id, args, extra);
|
||||
|
@ -80,6 +94,8 @@ inline void metadata(const QString& metadataType, const QVariantMap& args) {
|
|||
#define PROFILE_RANGE_EX(category, name, argbColor, payload, ...) Duration profileRangeThis(trace_##category(), name, argbColor, (uint64_t)payload, ##__VA_ARGS__);
|
||||
#define PROFILE_RANGE_BEGIN(category, rangeId, name, argbColor) rangeId = Duration::beginRange(trace_##category(), name, argbColor)
|
||||
#define PROFILE_RANGE_END(category, rangeId) Duration::endRange(trace_##category(), rangeId)
|
||||
#define PROFILE_SYNC_BEGIN(category, name, id, ...) syncBegin(trace_##category(), name, id, ##__VA_ARGS__);
|
||||
#define PROFILE_SYNC_END(category, name, id, ...) syncEnd(trace_##category(), name, id, ##__VA_ARGS__);
|
||||
#define PROFILE_ASYNC_BEGIN(category, name, id, ...) asyncBegin(trace_##category(), name, id, ##__VA_ARGS__);
|
||||
#define PROFILE_ASYNC_END(category, name, id, ...) asyncEnd(trace_##category(), name, id, ##__VA_ARGS__);
|
||||
#define PROFILE_COUNTER_IF_CHANGED(category, name, type, value) { static type lastValue = 0; type newValue = value; if (newValue != lastValue) { counter(trace_##category(), name, { { name, newValue }}); lastValue = newValue; } }
|
||||
|
|
|
@ -1173,7 +1173,6 @@ function MyController(hand) {
|
|||
};
|
||||
|
||||
this.update = function(deltaTime, timestamp) {
|
||||
Script.beginProfileRange("handControllerGrab:MyController:update")
|
||||
this.updateSmoothedTrigger();
|
||||
this.maybeScaleMyAvatar();
|
||||
|
||||
|
@ -1210,7 +1209,6 @@ function MyController(hand) {
|
|||
} else {
|
||||
print("WARNING: could not find state " + this.state + " in state machine");
|
||||
}
|
||||
Script.endProfileRange("handControllerGrab:MyController:update")
|
||||
};
|
||||
|
||||
this.callEntityMethodOnGrabbed = function(entityMethodName) {
|
||||
|
|
Loading…
Reference in a new issue