rosenpin / quick-draw-everywhere

Draw quickly anywhere on your device. Written in Kotlin
GNU General Public License v3.0
26 stars 9 forks source link

Loop decoding #14

Open cataloque opened 4 years ago

cataloque commented 4 years ago

Dear developers, I found some potential slow operations of bitmap displaying in quick-draw-everywhere.

In the position of quick-draw-everywhere: com.byox.drawview.c a() the bitmap object is created with the invocation of decodeByteArray(), I found a() is invoked by: (1) com.byox.drawview.views.DrawView onDraw() onDraw() callbacks are frequently invoked and this means that there will be many bitmap objects being created.so it's better to add cache for bitmap,that can prevent Loop decoding. and image decoding is done in UI thread. onDraw() callbacks are frequently invoked and this means that there will be many bitmap objects being created. Since image decoding is slow, for performance considerations, we should perform these operations in worker threads (e.g., via AsyncTask).

Looking forward to your response and hope I can help improve Conversations. Thanks.

rosenpin commented 4 years ago

Feel free to create a PR, but I believe the issue you're describing is that of the library I use in the app

https://github.com/ByoxCode/DrawView

Maybe consider opening an issue there