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

Use isolates to perform decoding #25

Open
aarol opened this issue Apr 30, 2021 · 5 comments
Open

Use isolates to perform decoding #25

aarol opened this issue Apr 30, 2021 · 5 comments

Comments

@aarol
Copy link

aarol commented Apr 30, 2021

Currently the performance is not very good, because the image decoding is done on unefficiently here. The decoding happens on the main thread which hangs up the application. The solution to this is to run the decoding process in a separate isolate and sending the bytearray throught the method channel.

I have made a barebones example of this approach which uses very big images and the performance gain is noticeable, there are no frame drops on my emulator.

I'm hoping someone with more knowledge of the package could implement this.

@edwinmacalopu
Copy link

Yes, this implementation is necessary for very large images and does not block the application

@Pavel401
Copy link

My application is lagging and frames are dropping constantly. How can I resolve this?

@aarol
Copy link
Author

aarol commented Nov 11, 2021

My application is lagging and frames are dropping constantly. How can I resolve this?

Are you using the code from the example? It should lag only for a small period probably due to memory being copied from the isolate.

@PraveenGongada
Copy link

PraveenGongada commented Nov 11, 2021

My application is lagging and frames are dropping constantly. How can I resolve this?

https://pub.dev/packages/wallpaper_manager_flutter use this package

Use this package, there will be no lag even for 4k images, thanks to @aarol for the idea.

@Pavel401
Copy link

Pavel401 commented Nov 11, 2021

Thanks @Praveen-0603 this package solved all my problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants