Skip to content

Added binary platform channels test#81874

Merged
gaaclarke merged 5 commits intoflutter:masterfrom
gaaclarke:binary-platform-channels-test
May 7, 2021
Merged

Added binary platform channels test#81874
gaaclarke merged 5 commits intoflutter:masterfrom
gaaclarke:binary-platform-channels-test

Conversation

@gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented May 5, 2021

This depends on #81414

issue: #81559

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label May 5, 2021
@google-cla google-cla bot added the cla: yes label May 5, 2021
@gaaclarke gaaclarke force-pushed the binary-platform-channels-test branch from 7008340 to 468f58f Compare May 5, 2021 17:26
@gaaclarke gaaclarke marked this pull request as ready for review May 6, 2021 21:13
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@gaaclarke gaaclarke requested a review from dnfield May 6, 2021 21:13
@gaaclarke
Copy link
Member Author

gaaclarke commented May 6, 2021

@dnfield Please give this a review. I know it's a bit of a pain because of Github's UI, but since the tree is blocked I don't want to get a huge backlog of reviews, too.

It might help if you click on the commits after 095c3a1, I think all of the changes are in main.dart It just cleans up that file and adds 2 more tests.

@gaaclarke gaaclarke force-pushed the binary-platform-channels-test branch from a73c7ac to c55a359 Compare May 7, 2021 16:35
@gaaclarke gaaclarke force-pushed the binary-platform-channels-test branch from c55a359 to 8a83dd3 Compare May 7, 2021 17:32
@gaaclarke
Copy link
Member Author

@dnfield It's been rebased now so it should be easy to review, I'll add @goderbauer too since I know you said your schedule might be weird today.

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.

Couple formatting nits. The warmup lap should be pretty simple.

Comment on lines 78 to 79
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no new line here, or add a comma to the end of the string and put the closing paren on a new line.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that and it didn't look any better to my eyes. Having a trailing comma for a parameter list is odd, it's not like an array or map literal. This is what the automatic formatter wants in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, imo If you have a newline after some opening punctuation, match it on the closing punctuation. doesn't make any sense. What is "it" and what should it be matched with? I read it about 20 times trying to understand how it applies to this case and I still don't get it but from the examples it seems applicable =P

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Future<double> _runBasicStandardSmall(
BasicMessageChannel<Object> basicStandard) async {
final Stopwatch watch = Stopwatch();
watch.start();
Copy link
Contributor

Choose a reason for hiding this comment

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

For this and the one below, we should have a warmup lap. Even though the Dart code is AOT in profile/release modes, on at least the Android side we'll be hitting JVM code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch before these are turned on, done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you add/commit the changes? I'm not seeing it yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

And in case it's not clear, what I mean by warmup here is to actually use the message channel at least once before you start the stop watch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep it's there. Each function is called with the parameter of count = 1 before it is actually measured.

Copy link
Member Author

Choose a reason for hiding this comment

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

The stopwatch happens for the warmup, but the result is thrown away

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahhh ok, thanks I missed that.

@gaaclarke gaaclarke requested review from dnfield and goderbauer May 7, 2021 17:34
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

const int numMessages = 2500;

final BenchmarkResultPrinter printer = BenchmarkResultPrinter();
await _runBasicStandardSmall(basicStandard, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here or in the method, consider adding ac omment about this being a warmup run.

@gaaclarke gaaclarke merged commit 8694e19 into flutter:master May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants