dckc / keepassdroid

Automatically exported from code.google.com/p/keepassdroid
0 stars 0 forks source link

potential improvement for responsiveness in keepassdroid #660

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello developers of KeePassDroid,

I'm a Ph.D. student and I'm doing research related to Android apps'
responsiveness. KeePassFroid uses "ProgressTask" to execute long
operations in backgroud thread to improve responsiveness. However, I
found there are still some cases that the database is accessed/queried
in UI thread. Do they affect the performance/responsiveness of the
app?

For example, in FileSelectActivity.java, the "fileHistory.deleteFile"
is invoked at line 400 in "onContextItemSelected", and the DB is
eventually accessed. How about put them into AsyncTask? I attach a
sample patch here to show this. Note that after put it into AsyncTask,
there are data races on "fileHistory", since "fileHistory" is also used in
other threads at several places (e.g., line 250, line 337). Thus, the
"fileHistory.init()" can be invoked concurrently, we could add
synchronization on it. I put line 287, 288 into AsyncTask as well.

Similarly, I also transformed PasswordActivity.java and put
"getKeyFile" method (which access DB) into AsyncTask.

There may be some other places that can be improved. What do you think
about these improvements? My thought is we can improve the
responsiveness if we try to avoid the access to DB in UI thread.

p.s., I also sent a pull request on github to explain this. What's your opinion?

Thanks,
Yu

Original issue reported on code.google.com by Yu.Lin...@gmail.com on 17 Feb 2014 at 6:31

Attachments:

GoogleCodeExporter commented 9 years ago
I sent these patches two weeks ago. Do you have any comments on them? Will the 
refactorings improve the responsiveness of keepassdroid.

Thanks,
Yu

Original comment by Yu.Lin...@gmail.com on 4 Mar 2014 at 11:40