Increase PDU parts buffer size for performance reasons

Changed the size of the temporary buffer used when storing a PDU part
to 8192 bytes instead of the previous 256 bytes. This greatly
decreases the time needed to store relatively large PDU parts. The
times to store PDU parts were so long that we frequently ended up with
an ANR. This change resulted in a total time usage of ~1000 ms instead
of ~10000 ms for ~500 kB worth of data.

Change-Id: Ia02cb28e4fd9dfe3aaa1fa30ff37659951cbed93
This commit is contained in:
Matthias Thomae
2010-12-15 15:43:31 +01:00
parent 472512f697
commit 9962ca12fb

View File

@@ -765,7 +765,7 @@ public class PduPersister {
Log.v(TAG, "Saving data to: " + uri);
}
byte[] buffer = new byte[256];
byte[] buffer = new byte[8192];
for (int len = 0; (len = is.read(buffer)) != -1; ) {
os.write(buffer, 0, len);
}