ethanblake4 / flutter_eval

Code push for Flutter, powered by dart_eval
https://pub.dev/packages/flutter_eval
BSD 3-Clause "New" or "Revised" License
303 stars 29 forks source link

each RuntimeWidget has a runtime instance, it has performance problem? #74

Open HXiaoMing opened 7 months ago

HXiaoMing commented 7 months ago

i want to use many RuntimeWidget in flutter in order to implement hot update. each RuntimeWidget has a runtime instance, it has performance problem? it is possible all RuntimeWidget use a same runtime singleton ? any good idea to use RuntimeWidget in flutter?

ethanblake4 commented 7 months ago

Why not use HotSwap instead of RuntimeWidget?

HXiaoMing commented 7 months ago

Why not use HotSwap instead of RuntimeWidget?为什么不使用 HotSwap RuntimeWidget呢?

Thanks for your reply.

Use HotSwap should place HotSwapLoader at the root of the flutter app. HotSwapLoader required a .evc file, it mean all the hot update code will generate in a same .evc file. The whole project hot update code it too many, the .evc file it is too big. In the future, it will be larger and larger. start an app is slowly cause the big .evc file.

For example, it fix a small bug, it will generate the whole project hot update code, output a large .evc file. No matter how small the bug, the user need download the only one, the large .evc file. I want to use RuntimeWidget to separate the big .evc file into many small .evc file to avoid this.

Any good idea to resolve it?

ethanblake4 commented 7 months ago

Have you actually tested that this causes a performance issue? I have not spent a lot of time on loading speed and size of EVC files because so far nobody has had this issue, but probably it could be improved greatly if this was an actual problem for you.

I want to use RuntimeWidget to separate the big .evc file into many small .evc file to avoid this.

There is no way to load multiple .evc files with a single Runtime, it is one Runtime per evc file always.

HXiaoMing commented 7 months ago

Have you actually tested that this causes a performance issue? I have not spent a lot of time on loading speed and size of EVC files because so far nobody has had this issue, but probably it could be improved greatly if this was an actual problem for you.

I want to use RuntimeWidget to separate the big .evc file into many small .evc file to avoid this.

There is no way to load multiple .evc files with a single Runtime, it is one Runtime per evc file always.

I have not actually tested that. Many runtime instance , let the data communication becomes more complex.

ethanblake4 commented 7 months ago

Well I would recommend that you shouldn't try to optimize performance until it is actually an issue that you have, then I can help you.