amazon web services - Aws SimpleDB, getting slow responce in android -
i using aws simpledb store data android app. using aws android sdk, getting late responce, there way improve it, in browser, getting data in 300 milliseconds me taking 5 10 seconds times more though sending request 40 rows only.
here doing.
private threadpoolexecutor threadpool = new threadpoolexecutor(poolsize, maxpoolsize, keepalivetime, timeunit.seconds, threadsqueue); private void getarticles() { string[] categories = {"kids", "boys", "girls", "men", "women"}; for(final string category : categories) { runtask(new runnable() { @override public void run() { log.e(tag, "getting articles category : " + category); string select = "select * shopdatabase category = '" + category + "' , relationtype " + "= 'none' , articlepushtime > '2013-04-01 05:46:03.719 gmt+00:00' , publishdatetime > '2013-04-01 05:46:03.719 gmt+00:00' " + " , score > '0' order score desc limit 40"; selectrequest selectrequest = new selectrequest(select); selectrequest.setconsistentread(true); list<item> articles = sdbclient.select(selectrequest).getitems(); if(articles != null) { logger.log("error", "sqliteactivity", "articles size : " + articles.size() + " category : " + category, runcount); } else { logger.log("error", "sqliteactivity", "articles size : articles.size() = 0 or null category : " + category, runcount); } ondownload.ondownload(); } }); } }
public void runtask(runnable task) { futures.add(threadpool.submit(task)); // threadpool.execute(task); }
i tried profile , found taking lot of time unmarshalling, , every request getting credentials.
log responce time:
04-05 11:39:30.724: e/sqliteactivity(14448): getting articles category : kids 04-05 11:39:49.914: e/sqliteactivity(14448): articles size : 40 category : kids 04-05 11:39:30.754: e/sqliteactivity(14448): getting articles category : boys 04-05 11:39:47.644: e/sqliteactivity(14448): articles size : 40 category : boys 04-05 11:39:48.964: e/sqliteactivity(14448): getting articles category : girls 04-05 11:40:02.464: e/sqliteactivity(14448): articles size : 40 category : girls 04-05 11:39:49.924: e/sqliteactivity(14448): getting articles category : men 04-05 11:40:02.724: e/sqliteactivity(14448): articles size : 40 category : men 04-05 11:40:02.664: e/sqliteactivity(14448): getting articles category : women 04-05 11:40:10.024: e/sqliteactivity(14448): articles size : 40 category : women
Comments
Post a Comment