Subsampling for BitmapFactory.decodeByteArray() does speed up the process to certain point 

Android's BitmapFactory.decodeXX such as BitmapFactory.decodeByteArray() is both time consuming and resource consuming.

The following table shows the time to decode 100 images of 1280x720 by BitmapFactory.decodeByteArray() with differrent subsampling sizes.   The performance benefit probably diminishes or even reverses with the increase of the subsampling size.  The turning point may be image size dependent.  The indication of this result is likely appliable to other BitmapFactory.decodeXX methods.
Time of docoding 100 1280x720 images (ms)

inSampleSize Test 1Test 2Test 3
1908322163657
2220216021506
4371427032562

The test is a quick one to get some sense, not a rigorous one.

This article was updated on 09:43:40 2025-04-09