-
Notifications
You must be signed in to change notification settings - Fork 19
getImage function slows down ui #23
Comments
I will look into optimizing this functionality in the scope of release v0.1.0. Probably it's nice to move some of part of this implementation from Kotlin to Dart if possible. Might improve performance. I will probably also add a warning to the readme that it can slow down the UI. when using this functionality. |
Added the warning to readme linked to this issue. |
@Joran-Dob thanks! I will also look into some possible solutions. |
OK, I discovered that the issue is on the Kotlin side of the code, the issue is that you can't just send the image "as is" because it is a Bitmap which is not supported by flutter, and the conversion takes a while. |
@BMXsanko awesome, I might have some time tomorrow to look into optimization of this conversion |
@Joran-Dob I have looked into the issue I tried wrapping the getImage() method into the compute() function, which puts the function you assign it on a separate isolate, this, in theory, should have solved the issue but then I discovered this: flutter/flutter#13937 |
Ok, I made a PR regarding this issue, I didn't have time to fully test it, on the first look it seems to improve performance. |
…formance-fix Issue #23 get image function performance fix
Merged the pull request. I will also merge some changes I made in a bit. And afterwards, close this issue! Thanks for your awesome work 😎 |
Does that mean the warning may be removed from the readme as well? |
The getImage function I added a few days ago is working fine, but it slows down the UI a lot, especially when you request a lot of images at once. I am not really sure whether the slowdown happens on the Dart side or on the Kotlin side... @Joran-Dob any idea why this might be?
The text was updated successfully, but these errors were encountered: