Skip to content

[Engine] FrameTiming and TimelineSummary's frame build time are not consistent #62689

@CareF

Description

@CareF

Tested in this branch: https://github.com/CareF/flutter/tree/compare_frametiming_and_timeline/dev/benchmarks/macrobenchmarks
in macrobenchmarks with the following command:

flutter [--local-engine-src-path ~/engine/src --local-engine=android_profile] drive \
    -t test/cull_opacity_perf_e2e.dart --driver test_driver/e2e_test.dart --profile --trace-startup

on a moto G4.
old_time

With this change: https://github.com/CareF/engine/commit/da7a71839c7a4ad0c39bd120f88359fb935307e5 (https://github.com/CareF/engine/tree/test_frame_timing), the difference can be reduced to:
new_time


To plot the figure, run the Python code in macrobenchmarks/build

#!/usr/bin/env python3
# -*- coding:utf-8 -*-

from pylab import *
import json

def get_build_times(filename):
	with open(filename, 'r') as f:
		data = json.load(f)
	return data['frame_build_times']

if __name__ == '__main__':
	e2e_frame_build = np.array(get_build_times('e2e_perf_summary.json')[1:])
	timeline_frame_build = np.array(get_build_times('e2e_timeline.timeline_summary.json'))
	plot(e2e_frame_build, label='FrameTIming.buildDuration')
	plot(timeline_frame_build, label='TimelineSummary.frame_build_times')
	# show()
	plot(e2e_frame_build - timeline_frame_build[:len(e2e_frame_build)], label='delta')
	legend()
	xlabel('frame index')
	ylabel('time in microseconds')
	ylim(-1E4, 80000)
	show()

/cc @liyuqian @iskakaushik

Metadata

Metadata

Assignees

Labels

engineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions