architdwivedi0 / vudroid

Automatically exported from code.google.com/p/vudroid
0 stars 0 forks source link

a potential improvement for responsiveness of vudroid #125

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello developers of vudroid,

I'm a Ph.D. student and I'm doing research related to Android apps'
responsiveness. vudroid uses background thread to decode Bitmaps to
improve responsiveness. However, I found there is still one case that
the Bitmap is decoded by UI thread. Does it affect the
performance/responsiveness of the app?

In ZoomRoll.java, four bitmaps "left", "right", "center" and "serifs"
is decoded in the constructor of ZoomRoll in UI thread (line 30). How
about putting them into AsyncTask? I attach a sample patch here to
show this. Note that after putting them into AsyncTask, there are races
on these bitmaps, since they are also used in "onMeasure" and "draw"
methods which are invoked by UI thread (e.g., line 51).  To avoid
NullPointerException, I add null check before using them (e.g.,
if(left == null) return;).

What do you think about this improvement? My thought is we can improve
the responsiveness if we try to avoid the decoding in UI thread.

Thanks,
Yu

Original issue reported on code.google.com by Yu.Lin...@gmail.com on 17 Feb 2014 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago
Hello developers of vudroid,

I sent these patches two weeks ago. Do you have any comments on them? Will the 
refactorings improve the responsiveness of vudroid.

Thanks,
Yu

Original comment by Yu.Lin...@gmail.com on 4 Mar 2014 at 11:41