Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@iskakaushik
Copy link
Contributor

No description provided.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm once license issue is resolved. Should just need to add the new files to the golden copy


void TearDown(const ::benchmark::State& state) {}

void Wait() { latch_.Wait(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure a latch needs to be part of the fixture. Can the benchmark just not create one on its own as needed? That it is an auto reset latch is not immediately obvious from using the fixture. The other setup as part of inheriting from FixturesBase is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

})));
AddNativeCallback(
"NotifyNative",
CREATE_NATIVE_ENTRY(([this](Dart_NativeArguments args) { Signal(); })));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just removal of unrelated log spam right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup


namespace flutter::testing {

class FixturesBase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this something like DartFixture or something? Since this fixture seems to be primarily dealing with setting up the VM and isolates in various modes? Perhaps also add a docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#include "flutter/testing/testing.h"
#include "flutter/testing/thread_test.h"

namespace flutter::testing {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, I am only now realizing you can nest namespaces like this. Pretty cool.

FML_DISALLOW_COPY_AND_ASSIGN(DartNativeBenchmarks);
};

BENCHMARK_F(DartNativeBenchmarks, DartNativeMessages)(benchmark::State& st) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For new benchmarks in this harness, it may be a good idea to add a docstring that explains what the benchmark is trying to measure as well as a more elaborate name. Right now, "DartNativeMessages" is pretty vague. I expected this case to measure the time it takes to make a call from Dart code to native code repeatedly. Instead, this benchmark measures time to first Dart message from a newly created isolate in a brand new VM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, something like, "TimeToFirstNativeMessageFromIsolateInNewVM". I guess its verbose but gets the job done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I also want to measure sending multiple messages from dart to native. I've added another test for that as well.

@iskakaushik iskakaushik added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Sep 8, 2021
@fluttergithubbot fluttergithubbot merged commit 3155b00 into flutter:master Sep 8, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 8, 2021
@chinmaygarde
Copy link
Member

Potential cause of the tree being red. Investigating.

chinmaygarde added a commit that referenced this pull request Sep 8, 2021
chinmaygarde added a commit that referenced this pull request Sep 8, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2021
iskakaushik added a commit that referenced this pull request Sep 8, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 8, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 9, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 10, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 13, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 13, 2021
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Sep 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants