Optimize app grid performance on lower end devices

This commit is contained in:
Cameron Gutman 2015-03-23 15:12:25 -04:00
parent 115853fed2
commit 7ab0be3b62
2 changed files with 7 additions and 6 deletions

View File

@ -31,7 +31,8 @@ import android.os.IBinder;
import org.xmlpull.v1.XmlPullParserException;
public class ComputerManagerService extends Service {
private static final int POLLING_PERIOD_MS = 3000;
private static final int SERVERINFO_POLLING_PERIOD_MS = 3000;
private static final int APPLIST_POLLING_PERIOD_MS = 30000;
private static final int MDNS_QUERY_PERIOD_MS = 1000;
private static final int FAST_POLL_TIMEOUT = 500;
private static final int OFFLINE_POLL_TRIES = 3;
@ -135,7 +136,7 @@ public class ComputerManagerService extends Service {
}
// Wait until the next polling interval
Thread.sleep(POLLING_PERIOD_MS / ((offlineCount > 0) ? 2 : 1));
Thread.sleep(SERVERINFO_POLLING_PERIOD_MS / ((offlineCount > 0) ? 2 : 1));
} catch (InterruptedException e) {
break;
}
@ -581,7 +582,7 @@ public class ComputerManagerService extends Service {
private boolean waitPollingDelay() {
try {
synchronized (pollEvent) {
pollEvent.wait(POLLING_PERIOD_MS);
pollEvent.wait(APPLIST_POLLING_PERIOD_MS);
}
} catch (InterruptedException e) {
return false;

View File

@ -17,9 +17,9 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class CachedAppAssetLoader {
private static final int MAX_CONCURRENT_DISK_LOADS = 4;
private static final int MAX_CONCURRENT_NETWORK_LOADS = 4;
private static final int MAX_CONCURRENT_CACHE_LOADS = 2;
private static final int MAX_CONCURRENT_DISK_LOADS = 3;
private static final int MAX_CONCURRENT_NETWORK_LOADS = 3;
private static final int MAX_CONCURRENT_CACHE_LOADS = 1;
private static final int MAX_PENDING_CACHE_LOADS = 100;
private static final int MAX_PENDING_NETWORK_LOADS = 40;