flutter_eval icon indicating copy to clipboard operation
flutter_eval copied to clipboard

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

Open HXiaoMing opened this issue 11 months ago • 5 comments

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?

HXiaoMing avatar Feb 27 '24 02:02 HXiaoMing

Why not use HotSwap instead of RuntimeWidget?

ethanblake4 avatar Feb 27 '24 04:02 ethanblake4

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?

HXiaoMing avatar Feb 27 '24 10:02 HXiaoMing

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.

ethanblake4 avatar Feb 27 '24 18:02 ethanblake4

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.

HXiaoMing avatar Feb 28 '24 02:02 HXiaoMing

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.

ethanblake4 avatar Feb 28 '24 04:02 ethanblake4