Comments (10)
google/flutter-desktop-embedding#58
from go-flutter.
So I finally got google/fde to build and run on my windows machine and the performance / resource usage was a lot lower than what I saw with Go bindings here, so it's not completely on Flutter here, is there anything we can do to figure out what's causing the constant 15% on idle?
from go-flutter.
On which platform are you running ?
from go-flutter.
Both of the embedders were tested on Windows 10 x64. With go version go1.11rc1
, which is a bit behind, but not enough to cause any drastic changes, the sample builds in gh releases were showing the same results anyway.
from go-flutter.
Using glfw.PollEvents()
in gutter.go is way more CPU intensive than using glfw.WaitEvents()
.
If you want the embedder to receive a platform plugin message from the flutter side. The line flutter.EngineFlushPendingTasksNow()
has to be run (flutter#16912).
When using glfw.PollEvents()
the line flutter.EngineFlushPendingTasksNow()
is always called (infinite loop). If we use glfw.WaitEvents()
(The best solution to improve the resource usage ) there has to be a new frame to be rendered to notify the embedder of a new platform message.
I'm using glfw.PollEvents()
for the demo because in some edge cases the platform message was not received by the embedder, making the keyboard plugin fail.
from go-flutter.
The Windows version of flutter-desktop-embedding seems to be using glfwWaitEvents
from go-flutter.
Alright awesome, after switching to WaitEvents the CPU usage has become tolerable for my use case.
As you mentioned using this method has its drawbacks too, keyboard plugin in particular, even though I've yet to notice said edge cases from my short testing, but since my project will likely not require much keyboard input, I will hope it's going to be okay for me.
I am assuming nothing else can really be done about this until 16912 is resolved.
from go-flutter.
Just bumping this as I am experiencing similar issues. Are you saying 15% total CPU or single core utilization? Because I am getting 100% single thread utilization that is locked to one core (with the same environment using the simple demo example).
Unfortunately trying to use this in an embedded setting(Intel NUC) won't end well 🌶️ 🌶️ 🌶️
I have tried switching to WaitEvents and this completely solves the issue, I am also not seeing the edge case mentioned.
from go-flutter.
I have included a change in #86 that should improve this issue by limiting the message loop to ~60fps iterations.
from go-flutter.
#86 has been merged.The performence is not yet 100% efficient, but seems to be the best we can do with the currently available features from engine/embedder. It's certainly not "poor performance" anymore, so I'm closing this issue.
from go-flutter.
Related Issues (20)
- Does the hover build command display content that does not support compiling for android or ios?
- Render problem in linux HOT 7
- [Flutter 3] There is no hot-reload in Hover v0.47.0 HOT 5
- no handler found for channel flutter/restoration HOT 1
- Mobile support? HOT 1
- arm linux supper
- Hover bug HOT 2
- Auto-Updating app like discord or telegram desktops
- It is very difficult to transfer data between go language and flutter HOT 1
- how to show golang runtime log not hover log?
- Unable to build anything (no .packages file) HOT 2
- How to debug golang code? HOT 1
- General Question: how is this different from flutter's own desktop solution HOT 1
- Example project 'stocks' doesn't work HOT 2
- build windows release failure HOT 3
- Can I use it on the arm64 Linux platform now HOT 1
- `hover run` not runed HOT 2
- can not run any demo HOT 6
- hover: failed to read the 'go.mod' file: C:\Users\Administrator\Downloads\my_app\go\go.mod: C:\Users\Administrator\Downloads\my_app\go\go.mod:3: invalid go version '1.21.5': must match format 1.23 HOT 1
- Error running hover examples (libflutter_engine.so: no such file or directory)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-flutter.