Skip to content
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

Potential optimization: Auto AOT when possible, and fallback to interpreted #67

Open
fzyzcjy opened this issue Oct 20, 2022 · 7 comments
Labels
performance Issue related to speed or performance

Comments

@fzyzcjy
Copy link

fzyzcjy commented Oct 20, 2022

For example, say I release v1.0.0 app with 10 pages. Then in v1.0.1, I change the UI (i.e. HomePage.build), and a few logic (e.g. HomePage.handleMyButtonClick).

Then, would be great to have all other pages (SecondPage, ThirdPage, ...) all in AOT, and also making all other untouched methods in HomePage still AOT, while only making HomePage.build and HomePage.handleMyButtonClick interpreted.

This is because an app will not change most of things in a hot update.

(Not sure whether I have mentioned this thought somewhere before)

@ethanblake4
Copy link
Owner

ethanblake4 commented Oct 20, 2022

The first part of doing this is covered in #53 and ethanblake4/flutter_eval#3 which I would like to have working in v0.6 (next major release).

The second part is basically some kind of auto-diffing to see what has changed since the last version. I have thought about that but it's definitely a 1.0 or post-1.0 feature.

@fzyzcjy
Copy link
Author

fzyzcjy commented Oct 20, 2022

The first part of doing this is covered in #53 and ethanblake4/flutter_eval#3 which I would like to have working in v0.6 (next major release).

Looking forward to that!

some kind of auto-diffing to see what has changed since the last version.

For a minimalist solution (which does create false positive though) - Maybe just generate bytecode for each and every code, and check equality?

@ethanblake4
Copy link
Owner

For a minimalist solution (which does create false positive though) - Maybe just generate bytecode for each and every code, and check equality?

I don't really understand, can you explain more? What is it checking equality to?

@fzyzcjy
Copy link
Author

fzyzcjy commented Oct 20, 2022

Checking eq of bytecode bytes?

@ethanblake4
Copy link
Owner

So you are saying, generate bytecode for 'before' and 'after' case and then just see what has changed? Unfortunately i don't think that's possible due to the way the bytecode works (even a minor change to one part of the code can cause a lot of bytecodes to change, because they can store absolute offsets for functions/jumps which get 'pushed' by all previous changes)

@ethanblake4
Copy link
Owner

I will add though, it maybe should not work like that because it's also annoying for incremental compilation. Maybe we can do that then if I end up changing it

@fzyzcjy
Copy link
Author

fzyzcjy commented Oct 21, 2022

Oh I see. That is a problem

@ethanblake4 ethanblake4 added the performance Issue related to speed or performance label Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issue related to speed or performance
Projects
None yet
Development

No branches or pull requests

2 participants