Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions shell/common/shell_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ static void StartupAndShutdownShell(benchmark::State& state,

FML_CHECK(shell);

{
// The ui thread could be busy processing tasks after shell created, e.g.,
// default font manager setup. The measurement of shell shutdown should be
// considered after those ui tasks have been done.
benchmarking::ScopedPauseTiming pause(state, true);
fml::AutoResetWaitableEvent latch;
fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
[&latch]() { latch.Signal(); });
latch.Wait();
}

{
benchmarking::ScopedPauseTiming pause(state, !measure_shutdown);
// Shutdown must occur synchronously on the platform thread.
Expand Down