-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide APIs for the PlatformDispatcher to set the performance mode #35614
Conversation
lib/ui/platform_dispatcher.dart
Outdated
/// Returns the old performance mode of the Dart VM. | ||
/// | ||
/// See [DartPerformanceMode] for more information on individual performance modes. | ||
DartPerformanceMode requestDartPerformanceMode(DartPerformanceMode mode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not necessarily return the current performance mode. What is the plan for this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mostly going to use it when adding tests on the framework side, makes it easy to assert instead of having to add GetCurrentPerformanceMode
. Let me know if you think this is a bad idea, happy to make it a void function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider removing it, and the asserts in the framework should track whether or not the requested GC modes are consistent.
Consider: we may wish to disable this functionality on certain platforms, or tune other changes in the engine that overrwrite the requested mode. If we tell people what the resulting mode is we're going to make that part of the contract of this API - which folks will depend on, eventually.
Also consider: in the event the framework is making bad requests, but the engine is ignoring those requests for an unrelated reason, we'd like the framework asset/test to still fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are valid points, will make it not return anything for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need a web impl, but since this is just a request it can no-op
c67e90e
to
683a736
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
No description provided.