diff options
| author | blong <blong@codeaurora.org> | 2015-07-17 16:07:35 +0800 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:29:19 -0600 |
| commit | 22b057b0863763c2f4634935dd09c15e3f1e11d7 (patch) | |
| tree | 7c0827a68f5c89df6ab25c46583bb2c82e68316f | |
| parent | b5f51a734ff5c957dd407fbb985bfabf5c5e5dec (diff) | |
| download | android_frameworks_opt_vcard-cm-13.0.tar.gz android_frameworks_opt_vcard-cm-13.0.tar.bz2 android_frameworks_opt_vcard-cm-13.0.zip | |
Performance: Fix importing vcard slowly problemHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0Ecm-13.0
Enlarge the batch size to reduce db times and save importing time.
Change-Id: Ic5e259abeefb2081d454d7444ff94a456cea7419
CRs-Fixed: 875712
| -rw-r--r-- | java/com/android/vcard/VCardEntryCommitter.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/com/android/vcard/VCardEntryCommitter.java b/java/com/android/vcard/VCardEntryCommitter.java index 7f8e885..17e0318 100644 --- a/java/com/android/vcard/VCardEntryCommitter.java +++ b/java/com/android/vcard/VCardEntryCommitter.java @@ -70,7 +70,12 @@ public class VCardEntryCommitter implements VCardEntryHandler { final long start = System.currentTimeMillis(); mOperationList = vcardEntry.constructInsertOperations(mContentResolver, mOperationList); mCounter++; - if (mCounter >= 20) { + //because the max batch size is 500 defined in ContactsProvider,so we enlarge this batch + //size to at least 460, when the batch size is bigger than it,the batch operation will be + //excuted. this could save db times when the batch size is more bigger, for example, for + //10000 contacts data, if batch size is 20, it needs excute 500 times while batch size is + //500, it only needs excute 20 times. + if (mOperationList != null && mOperationList.size() >= 460) { mCreatedUris.add(pushIntoContentResolver(mOperationList)); mCounter = 0; mOperationList = null; |
