Bug 1380972 - Tighten up our defintion of what constitutes a 'long' slice r=sfink

This commit is contained in:
Jon Coppeard 2017-07-19 16:52:48 +01:00
Родитель 4056892ff5
Коммит e428e12a6b
2 изменённых файлов: 18 добавлений и 16 удалений

Просмотреть файл

@ -986,14 +986,18 @@ Statistics::endSlice()
if (budget_ms == runtime->gc.defaultSliceBudget()) if (budget_ms == runtime->gc.defaultSliceBudget())
runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime)); runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime));
// Record any phase that goes more than 2x over its budget. // Record any phase that goes 1.5 times or 5ms over its budget.
if (sliceTime.ToMilliseconds() > 2 * budget_ms) { double longSliceThreshold = std::min(1.5 * budget_ms, budget_ms + 5.0);
reportLongestPhaseInMajorGC(slice.phaseTimes, JS_TELEMETRY_GC_SLOW_PHASE); if (sliceTime.ToMilliseconds() > longSliceThreshold) {
// If we spend a significant length of time waiting for parallel PhaseKind longest = LongestPhaseSelfTimeInMajorGC(slice.phaseTimes);
// tasks then report the longest task. reportLongestPhaseInMajorGC(longest, JS_TELEMETRY_GC_SLOW_PHASE);
TimeDuration joinTime = SumPhase(PhaseKind::JOIN_PARALLEL_TASKS, slice.phaseTimes);
if (joinTime.ToMilliseconds() > budget_ms) // If the longest phase was waiting for parallel tasks then
reportLongestPhaseInMajorGC(slice.parallelTimes, JS_TELEMETRY_GC_SLOW_TASK); // record the longest task.
if (longest == PhaseKind::JOIN_PARALLEL_TASKS) {
PhaseKind longestParallel = LongestPhaseSelfTimeInMajorGC(slice.parallelTimes);
reportLongestPhaseInMajorGC(longestParallel, JS_TELEMETRY_GC_SLOW_TASK);
}
} }
// Record how long we went over budget. // Record how long we went over budget.
@ -1047,14 +1051,12 @@ Statistics::endSlice()
} }
void void
Statistics::reportLongestPhaseInMajorGC(const PhaseTimeTable& times, int telemetryId) Statistics::reportLongestPhaseInMajorGC(PhaseKind longest, int telemetryId)
{ {
PhaseKind longest = LongestPhaseSelfTimeInMajorGC(times); if (longest != PhaseKind::NONE) {
if (longest == PhaseKind::NONE) uint8_t bucket = phaseKinds[longest].telemetryBucket;
return; runtime->addTelemetry(telemetryId, bucket);
}
uint8_t bucket = phaseKinds[longest].telemetryBucket;
runtime->addTelemetry(telemetryId, bucket);
} }
bool bool

Просмотреть файл

@ -370,7 +370,7 @@ FOR_EACH_GC_PROFILE_TIME(DEFINE_TIME_KEY)
void sccDurations(TimeDuration* total, TimeDuration* maxPause) const; void sccDurations(TimeDuration* total, TimeDuration* maxPause) const;
void printStats(); void printStats();
void reportLongestPhaseInMajorGC(const PhaseTimeTable& times, int telemetryId); void reportLongestPhaseInMajorGC(PhaseKind longest, int telemetryId);
UniqueChars formatCompactSlicePhaseTimes(const PhaseTimeTable& phaseTimes) const; UniqueChars formatCompactSlicePhaseTimes(const PhaseTimeTable& phaseTimes) const;