我有性能问题,我不知道它来自哪里。
createLogoutURL 和第一个数据存储查询之间的差距是巨大的......它在以下代码段落之间:
loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri));
...
ch.zhaw.ams.server.auth.user.User userAms = DatabaseHelper.findByParama(user.getEmail(), "emailAddress",
"String", ch.zhaw.ams.server.auth.user.User.class);
@Override
public GoogleLoginInfo login(String requestUri) {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
GoogleLoginInfo loginInfo = new GoogleLoginInfo();
if (user != null) {
loginInfo.setLoggedIn(true);
loginInfo.setEmailAddress(user.getEmail());
loginInfo.setNickname(user.getNickname());
loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri));
loginInfo.setIsGoogleLogin(true);
ch.zhaw.ams.server.auth.user.User userAms = DatabaseHelper.findByParama(user.getEmail(), "emailAddress",
"String", ch.zhaw.ams.server.auth.user.User.class);
if (userAms != null) {
loginInfo.setFirstname(userAms.getFirstName());
loginInfo.setLastname(userAms.getLastName());
}
// Set Memcache
try {
SessionCache.setupCache(user.getEmail());
loginInfo.setIsCached(true);
} catch (CacheException e) {
// TODO Auto-generated catch block
e.printStackTrace();
loginInfo.setIsCached(false);
}
} else {
loginInfo.setLoggedIn(false);
loginInfo.setLoginUrl(userService.createLoginURL(requestUri));
}
return loginInfo;
}
有人知道它为什么这么慢吗?