Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ struct Settings {
// Max bytes threshold of resource cache, or 0 for unlimited.
size_t resource_cache_max_bytes_threshold = 0;

/// A timestamp representing when the engine started. The value is based
/// on the clock used by the Dart timeline APIs. This timestamp is used
/// to log a timeline event that tracks the latency of engine startup.
std::chrono::microseconds engine_start_timestamp = {};

/// The minimum number of samples to require in multipsampled anti-aliasing.
///
/// Setting this value to 0 or 1 disables MSAA.
Expand Down
26 changes: 13 additions & 13 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,19 +467,19 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
// Send the earliest available timestamp in the application lifecycle to
// timeline. The difference between this timestamp and the time we render
// the very first frame gives us a good idea about Flutter's startup time.
// Use a duration event so about:tracing will consider this event when
// deciding the earliest event to use as time 0.
if (settings_.engine_start_timestamp.count()) {
Dart_TimelineEvent(
"FlutterEngineMainEnter", // label
settings_.engine_start_timestamp.count(), // timestamp0
Dart_TimelineGetMicros(), // timestamp1_or_async_id
Dart_Timeline_Event_Duration, // event type
0, // argument_count
nullptr, // argument_names
nullptr // argument_values
);
}
// Use an instant event because the call to Dart_TimelineGetMicros
// may behave differently before and after the Dart VM is initialized.
// As this call is immediately after initialization of the Dart VM,
// we are interested in only one timestamp.
int64_t micros = Dart_TimelineGetMicros();
Dart_TimelineEvent("FlutterEngineMainEnter", // label
micros, // timestamp0
micros, // timestamp1_or_async_id
Dart_Timeline_Event_Instant, // event type
0, // argument_count
nullptr, // argument_names
nullptr // argument_values
);
}

Dart_SetFileModifiedCallback(&DartFileModifiedCallback);
Expand Down
5 changes: 0 additions & 5 deletions shell/common/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ void PerformInitializationTasks(Settings& settings) {

static std::once_flag gShellSettingsInitialization = {};
std::call_once(gShellSettingsInitialization, [&settings] {
if (settings.engine_start_timestamp.count() == 0) {
settings.engine_start_timestamp =
std::chrono::microseconds(Dart_TimelineGetMicros());
}

tonic::SetLogHandler(
[](const char* message) { FML_LOG(ERROR) << message; });

Expand Down
4 changes: 0 additions & 4 deletions shell/platform/android/flutter_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ void FlutterMain::Init(JNIEnv* env,
settings.enable_timeline_event_handler = settings.trace_systrace;
#endif // FLUTTER_RELEASE

int64_t init_time_micros = initTimeMillis * 1000;
settings.engine_start_timestamp =
std::chrono::microseconds(Dart_TimelineGetMicros() - init_time_micros);

// Restore the callback cache.
// TODO(chinmaygarde): Route all cache file access through FML and remove this
// setter.
Expand Down