Skip to content

Commit

Permalink
Break early out of metrics calculation due to sorted frames
Browse files Browse the repository at this point in the history
  • Loading branch information
buenaflor committed Jun 24, 2024
1 parent 71cdcdb commit 28de2ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flutter/lib/src/span_frame_metrics_collector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ class SpanFrameMetricsCollector implements PerformanceContinuousCollector {
final fullFrameDelay = max(0, frameDuration - expectedFrameDuration);
final intersectionRatio = effectiveDuration / frameDuration;
effectiveDelay = (fullFrameDelay * intersectionRatio).round();
} else if (frameStartMs > spanEndMs) {
// Other frames will be newer than this span, as frames are ordered
break;
} else {
// Frame is completely outside the span, skip it
continue;
Expand Down

0 comments on commit 28de2ed

Please sign in to comment.