18 void TestBody()
override {};
36 while (state.KeepRunning()) {
38 bool successful = isolate->RunInIsolateScope([&]() ->
bool {
40 std::vector<uint8_t>
data(3 << 20, 0);
41 std::unique_ptr<fml::Mapping> mapping =
42 std::make_unique<fml::DataMapping>(
data);
44 Dart_Handle library = Dart_RootLibrary();
46 Dart_GetField(library, Dart_NewStringFromCString(
"messageCallback"));
48 auto message = fml::MakeRefCounted<PlatformMessageResponseDart>(
50 thread_host.
ui_thread->GetTaskRunner(),
"");
52 message->Complete(std::move(mapping));
62 std::promise<bool> completed;
64 [&completed] { completed.set_value(
true); });
65 completed.get_future().wait();
70 ->Unit(benchmark::kMicrosecond);
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
virtual Settings CreateSettingsForFixture()
virtual void PostTask(const fml::closure &task) override
G_BEGIN_DECLS GBytes * message
#define FML_CHECK(condition)
std::string GetDefaultKernelFilePath()
Returns the default path to kernel_blob.bin. This file is within the directory returned by GetFixture...
std::unique_ptr< AutoIsolateShutdown > RunDartCodeInIsolate(DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::unique_ptr< PlatformConfiguration > platform_configuration)
BENCHMARK(BM_ShellInitialization)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
static void BM_PlatformMessageResponseDartComplete(benchmark::State &state)
The collection of all the threads used by the engine.
std::unique_ptr< fml::Thread > io_thread
std::unique_ptr< fml::Thread > platform_thread
std::unique_ptr< fml::Thread > raster_thread
std::unique_ptr< fml::Thread > ui_thread