Skip to content

Commit

Permalink
remove overhead analysis by Timeline event since timeline itself need…
Browse files Browse the repository at this point in the history
…s time
  • Loading branch information
fzyzcjy committed Oct 16, 2022
1 parent ee39efe commit d9cc91f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 69 deletions.
40 changes: 19 additions & 21 deletions packages/smooth/lib/src/actor.dart
Expand Up @@ -23,30 +23,28 @@ class Actor {
final serviceLocator = ServiceLocator.instance;
if (serviceLocator.auxiliaryTreeRegistry.trees.isEmpty) return;

Timeline.timeSync('MaybePreemptRender', () {
final timeManager = serviceLocator.timeManager;
final now = clock.nowSimple();
final nowTimestamp =
serviceLocator.timeConverter.dateTimeToAdjustedFrameTimeStamp(now);

if (timeManager.thresholdActOnBuildOrLayoutPhaseTimeStamp! >=
nowTimestamp) {
// _debugLogMaybePreemptRender(haltReason: 'TimeTooEarly');
return;
}
final timeManager = serviceLocator.timeManager;
final now = clock.nowSimple();
final nowTimestamp =
serviceLocator.timeConverter.dateTimeToAdjustedFrameTimeStamp(now);

if (timeManager.thresholdActOnBuildOrLayoutPhaseTimeStamp! >=
nowTimestamp) {
// _debugLogMaybePreemptRender(haltReason: 'TimeTooEarly');
return;
}

// this should be called *after* time check, since this may be a bit more
// expensive
if (!_preludeBeforePreemptRender()) {
// _debugLogMaybePreemptRender(haltReason: 'PreludeDisagree');
return;
}
// this should be called *after* time check, since this may be a bit more
// expensive
if (!_preludeBeforePreemptRender()) {
// _debugLogMaybePreemptRender(haltReason: 'PreludeDisagree');
return;
}

_preemptRenderRaw(
debugReason: RunPipelineReason.preemptRenderBuildOrLayoutPhase);
_preemptRenderRaw(
debugReason: RunPipelineReason.preemptRenderBuildOrLayoutPhase);

timeManager.afterBuildOrLayoutPhasePreemptRender(now: nowTimestamp);
});
timeManager.afterBuildOrLayoutPhasePreemptRender(now: nowTimestamp);
}

void maybePreemptRenderPostDrawFramePhase() {
Expand Down
48 changes: 0 additions & 48 deletions scripts/timeline/overhead.py

This file was deleted.

0 comments on commit d9cc91f

Please sign in to comment.