Add benchmark for number of GCs in animated GIF (#81240)
This commit is contained in:
@@ -95,6 +95,20 @@ class TimelineSummary {
|
||||
/// The total number of rasterizer cycles recorded in the timeline.
|
||||
int countRasterizations() => _extractGpuRasterizerDrawDurations().length;
|
||||
|
||||
/// The total number of old generation garbage collections recorded in the timeline.
|
||||
int oldGenerationGarbageCollections() {
|
||||
return _timeline.events!.where((TimelineEvent event) {
|
||||
return event.category == 'GC' && event.name == 'CollectOldGeneration';
|
||||
}).length;
|
||||
}
|
||||
|
||||
/// The total number of new generation garbage collections recorded in the timeline.
|
||||
int newGenerationGarbageCollections() {
|
||||
return _timeline.events!.where((TimelineEvent event) {
|
||||
return event.category == 'GC' && event.name == 'CollectNewGeneration';
|
||||
}).length;
|
||||
}
|
||||
|
||||
/// Encodes this summary as JSON.
|
||||
///
|
||||
/// Data ends with "_time_millis" means time in milliseconds and numbers in
|
||||
@@ -176,6 +190,8 @@ class TimelineSummary {
|
||||
'missed_frame_rasterizer_budget_count': computeMissedFrameRasterizerBudgetCount(),
|
||||
'frame_count': countFrames(),
|
||||
'frame_rasterizer_count': countRasterizations(),
|
||||
'new_gen_gc_count': newGenerationGarbageCollections(),
|
||||
'old_gen_gc_count': oldGenerationGarbageCollections(),
|
||||
'frame_build_times': _extractFrameDurations()
|
||||
.map<int>((Duration duration) => duration.inMicroseconds)
|
||||
.toList(),
|
||||
|
||||
@@ -95,6 +95,38 @@ void main() {
|
||||
'ts': timeStamp,
|
||||
};
|
||||
|
||||
List<Map<String, dynamic>> newGenGC(int count) => List<Map<String, dynamic>>.filled(
|
||||
count,
|
||||
<String, dynamic>{
|
||||
'name': 'CollectNewGeneration',
|
||||
'cat': 'GC',
|
||||
'tid': 19695,
|
||||
'pid': 19650,
|
||||
'ts': 358849612473,
|
||||
'tts': 476761,
|
||||
'ph': 'B',
|
||||
'args': <String, dynamic>{
|
||||
'isolateGroupId': 'isolateGroups/10824099774666259225',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
List<Map<String, dynamic>> oldGenGC(int count) => List<Map<String, dynamic>>.filled(
|
||||
count,
|
||||
<String, dynamic>{
|
||||
'name': 'CollectOldGeneration',
|
||||
'cat': 'GC',
|
||||
'tid': 19695,
|
||||
'pid': 19650,
|
||||
'ts': 358849612473,
|
||||
'tts': 476761,
|
||||
'ph': 'B',
|
||||
'args': <String, dynamic>{
|
||||
'isolateGroupId': 'isolateGroups/10824099774666259225',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
List<Map<String, dynamic>> rasterizeTimeSequenceInMillis(List<int> sequence) {
|
||||
final List<Map<String, dynamic>> result = <Map<String, dynamic>>[];
|
||||
int t = 0;
|
||||
@@ -388,6 +420,8 @@ void main() {
|
||||
begin(1000), end(19000),
|
||||
begin(19000), end(29000),
|
||||
begin(29000), end(49000),
|
||||
...newGenGC(4),
|
||||
...oldGenGC(5),
|
||||
frameBegin(1000), frameEnd(18000),
|
||||
frameBegin(19000), frameEnd(28000),
|
||||
frameBegin(29000), frameEnd(48000),
|
||||
@@ -405,6 +439,8 @@ void main() {
|
||||
'missed_frame_rasterizer_budget_count': 2,
|
||||
'frame_count': 3,
|
||||
'frame_rasterizer_count': 3,
|
||||
'new_gen_gc_count': 4,
|
||||
'old_gen_gc_count': 5,
|
||||
'frame_build_times': <int>[17000, 9000, 19000],
|
||||
'frame_rasterizer_times': <int>[18000, 10000, 20000],
|
||||
'frame_begin_times': <int>[0, 18000, 28000],
|
||||
@@ -475,6 +511,8 @@ void main() {
|
||||
lagBegin(1000, 4), lagEnd(2000, 4),
|
||||
lagBegin(1200, 12), lagEnd(2400, 12),
|
||||
lagBegin(4200, 8), lagEnd(9400, 8),
|
||||
...newGenGC(4),
|
||||
...oldGenGC(5),
|
||||
cpuUsage(5000, 20), cpuUsage(5010, 60),
|
||||
memoryUsage(6000, 20, 40), memoryUsage(6100, 30, 45),
|
||||
platformVsync(7000), vsyncCallback(7500),
|
||||
@@ -494,6 +532,8 @@ void main() {
|
||||
'missed_frame_rasterizer_budget_count': 2,
|
||||
'frame_count': 3,
|
||||
'frame_rasterizer_count': 3,
|
||||
'new_gen_gc_count': 4,
|
||||
'old_gen_gc_count': 5,
|
||||
'frame_build_times': <int>[17000, 9000, 19000],
|
||||
'frame_rasterizer_times': <int>[18000, 10000, 20000],
|
||||
'frame_begin_times': <int>[0, 18000, 28000],
|
||||
|
||||
Reference in New Issue
Block a user