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 1 | Test 2 | Test 3 |
1 | 9083 | 2216 | 3657 |
2 | 2202 | 1602 | 1506 |
4 | 3714 | 2703 | 2562 |
The test is a quick one to get some sense, not a rigorous one.