Unverified Commit 7390cc5c authored by liyuqian's avatar liyuqian Committed by GitHub

Increase our build budget to 16ms (#27709)

Because we now have 2 separate GPU and UI threads.
parent f9a60900
...@@ -16,7 +16,7 @@ const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' '); ...@@ -16,7 +16,7 @@ const JsonEncoder _prettyEncoder = JsonEncoder.withIndent(' ');
/// The maximum amount of time considered safe to spend for a frame's build /// The maximum amount of time considered safe to spend for a frame's build
/// phase. Anything past that is in the danger of missing the frame as 60FPS. /// phase. Anything past that is in the danger of missing the frame as 60FPS.
const Duration kBuildBudget = Duration(milliseconds: 8); const Duration kBuildBudget = Duration(milliseconds: 16);
/// Extracts statistics from a [Timeline]. /// Extracts statistics from a [Timeline].
class TimelineSummary { class TimelineSummary {
......
...@@ -103,9 +103,9 @@ void main() { ...@@ -103,9 +103,9 @@ void main() {
group('computeMissedFrameBuildBudgetCount', () { group('computeMissedFrameBuildBudgetCount', () {
test('computes the number of missed build budgets', () { test('computes the number of missed build budgets', () {
final TimelineSummary summary = summarize(<Map<String, dynamic>>[ final TimelineSummary summary = summarize(<Map<String, dynamic>>[
build(1000, 9000), build(1000, 17000),
build(11000, 1000), build(19000, 9000),
build(13000, 10000), build(29000, 18000),
]); ]);
expect(summary.countFrames(), 3); expect(summary.countFrames(), 3);
...@@ -244,9 +244,9 @@ void main() { ...@@ -244,9 +244,9 @@ void main() {
group('computeMissedFrameRasterizerBudgetCount', () { group('computeMissedFrameRasterizerBudgetCount', () {
test('computes the number of missed rasterizer budgets', () { test('computes the number of missed rasterizer budgets', () {
final TimelineSummary summary = summarize(<Map<String, dynamic>>[ final TimelineSummary summary = summarize(<Map<String, dynamic>>[
begin(1000), end(10000), begin(1000), end(18000),
begin(11000), end(12000), begin(19000), end(28000),
begin(13000), end(23000), begin(29000), end(47000),
]); ]);
expect(summary.computeMissedFrameRasterizerBudgetCount(), 2); expect(summary.computeMissedFrameRasterizerBudgetCount(), 2);
...@@ -257,27 +257,27 @@ void main() { ...@@ -257,27 +257,27 @@ void main() {
test('computes and returns summary as JSON', () { test('computes and returns summary as JSON', () {
expect( expect(
summarize(<Map<String, dynamic>>[ summarize(<Map<String, dynamic>>[
begin(1000), end(11000), begin(1000), end(19000),
begin(11000), end(13000), begin(19000), end(29000),
begin(13000), end(25000), begin(29000), end(49000),
build(1000, 9000), build(1000, 17000),
build(11000, 1000), build(19000, 9000),
build(13000, 11000), build(29000, 19000),
]).summaryJson, ]).summaryJson,
<String, dynamic>{ <String, dynamic>{
'average_frame_build_time_millis': 7.0, 'average_frame_build_time_millis': 15.0,
'90th_percentile_frame_build_time_millis': 11.0, '90th_percentile_frame_build_time_millis': 19.0,
'99th_percentile_frame_build_time_millis': 11.0, '99th_percentile_frame_build_time_millis': 19.0,
'worst_frame_build_time_millis': 11.0, 'worst_frame_build_time_millis': 19.0,
'missed_frame_build_budget_count': 2, 'missed_frame_build_budget_count': 2,
'average_frame_rasterizer_time_millis': 8.0, 'average_frame_rasterizer_time_millis': 16.0,
'90th_percentile_frame_rasterizer_time_millis': 12.0, '90th_percentile_frame_rasterizer_time_millis': 20.0,
'99th_percentile_frame_rasterizer_time_millis': 12.0, '99th_percentile_frame_rasterizer_time_millis': 20.0,
'worst_frame_rasterizer_time_millis': 12.0, 'worst_frame_rasterizer_time_millis': 20.0,
'missed_frame_rasterizer_budget_count': 2, 'missed_frame_rasterizer_budget_count': 2,
'frame_count': 3, 'frame_count': 3,
'frame_build_times': <int>[9000, 1000, 11000], 'frame_build_times': <int>[17000, 9000, 19000],
'frame_rasterizer_times': <int>[10000, 2000, 12000], 'frame_rasterizer_times': <int>[18000, 10000, 20000],
} }
); );
}); });
...@@ -307,29 +307,29 @@ void main() { ...@@ -307,29 +307,29 @@ void main() {
test('writes summary to JSON file', () async { test('writes summary to JSON file', () async {
await summarize(<Map<String, dynamic>>[ await summarize(<Map<String, dynamic>>[
begin(1000), end(11000), begin(1000), end(19000),
begin(11000), end(13000), begin(19000), end(29000),
begin(13000), end(25000), begin(29000), end(49000),
build(1000, 9000), build(1000, 17000),
build(11000, 1000), build(19000, 9000),
build(13000, 11000), build(29000, 19000),
]).writeSummaryToFile('test', destinationDirectory: tempDir.path); ]).writeSummaryToFile('test', destinationDirectory: tempDir.path);
final String written = final String written =
await fs.file(path.join(tempDir.path, 'test.timeline_summary.json')).readAsString(); await fs.file(path.join(tempDir.path, 'test.timeline_summary.json')).readAsString();
expect(json.decode(written), <String, dynamic>{ expect(json.decode(written), <String, dynamic>{
'average_frame_build_time_millis': 7.0, 'average_frame_build_time_millis': 15.0,
'worst_frame_build_time_millis': 11.0, 'worst_frame_build_time_millis': 19.0,
'90th_percentile_frame_build_time_millis': 11.0, '90th_percentile_frame_build_time_millis': 19.0,
'99th_percentile_frame_build_time_millis': 11.0, '99th_percentile_frame_build_time_millis': 19.0,
'missed_frame_build_budget_count': 2, 'missed_frame_build_budget_count': 2,
'average_frame_rasterizer_time_millis': 8.0, 'average_frame_rasterizer_time_millis': 16.0,
'90th_percentile_frame_rasterizer_time_millis': 12.0, '90th_percentile_frame_rasterizer_time_millis': 20.0,
'99th_percentile_frame_rasterizer_time_millis': 12.0, '99th_percentile_frame_rasterizer_time_millis': 20.0,
'worst_frame_rasterizer_time_millis': 12.0, 'worst_frame_rasterizer_time_millis': 20.0,
'missed_frame_rasterizer_budget_count': 2, 'missed_frame_rasterizer_budget_count': 2,
'frame_count': 3, 'frame_count': 3,
'frame_build_times': <int>[9000, 1000, 11000], 'frame_build_times': <int>[17000, 9000, 19000],
'frame_rasterizer_times': <int>[10000, 2000, 12000], 'frame_rasterizer_times': <int>[18000, 10000, 20000],
}); });
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment