apply newer fluter runloop in run_loop.cpp for windows performance fix

This commit is contained in:
Dan Ballard 2021-06-30 16:27:14 -07:00
parent 1a8d91548e
commit 88114ac6eb
2 changed files with 22 additions and 29 deletions

View File

@ -42,7 +42,7 @@ packages:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -70,7 +70,7 @@ packages:
name: dbus name: dbus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.1" version: "0.5.2"
desktop_notifications: desktop_notifications:
dependency: "direct main" dependency: "direct main"
description: description:
@ -91,14 +91,14 @@ packages:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.2"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.1" version: "6.1.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -125,7 +125,7 @@ packages:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "2.0.1"
http: http:
dependency: transitive dependency: transitive
description: description:
@ -189,20 +189,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
node_interop:
dependency: transitive
description:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
node_io:
dependency: transitive
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@ -216,7 +202,7 @@ packages:
name: package_info_plus name: package_info_plus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.3"
package_info_plus_linux: package_info_plus_linux:
dependency: transitive dependency: transitive
description: description:
@ -244,14 +230,14 @@ packages:
name: package_info_plus_web name: package_info_plus_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.2"
package_info_plus_windows: package_info_plus_windows:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_windows name: package_info_plus_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.2"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -265,7 +251,7 @@ packages:
name: path_provider name: path_provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.2"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -300,14 +286,14 @@ packages:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.11.0" version: "1.11.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.2.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -382,7 +368,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.1" version: "0.4.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -403,7 +389,7 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.2.4"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:

View File

@ -9,7 +9,14 @@ RunLoop::RunLoop() {}
RunLoop::~RunLoop() {} RunLoop::~RunLoop() {}
void RunLoop::Run() { void RunLoop::Run() {
bool keep_running = true; // Fix/workaround for Windows high CPU usage
// https://github.com/flutter/flutter/issues/78517#issuecomment-814843107
MSG msg;
while (GetMessage(&msg, nullptr, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
/*bool keep_running = true;
TimePoint next_flutter_event_time = TimePoint::clock::now(); TimePoint next_flutter_event_time = TimePoint::clock::now();
while (keep_running) { while (keep_running) {
std::chrono::nanoseconds wait_duration = std::chrono::nanoseconds wait_duration =
@ -40,7 +47,7 @@ void RunLoop::Run() {
next_flutter_event_time = next_flutter_event_time =
std::min(next_flutter_event_time, ProcessFlutterMessages()); std::min(next_flutter_event_time, ProcessFlutterMessages());
} }
} }*/
} }
void RunLoop::RegisterFlutterInstance( void RunLoop::RegisterFlutterInstance(