You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are working on a project called PersisDroid (http://www.cudroid.com/PersisDroid/) for detecting potential performance issues. Our tool could find performance degradation caused by improper usage of asynchronous executions.
We find that in some cases your app may suffer a long processing delay.
Case 1: Related source code Class: LoadOPDSTask Method: doInBackground Circumstance Sometimes the network condition is poor. The user may switch activity before the OPDSfeed is obtained. The operation of request the feed should be cancelled as soon as possible. Problem Some network request AsyncTasks are already cancelled but they are not stop immediately. These tasks may consume unnecessary network resource. Suggested modification Check one more time whether the task is cancelled after the second network request via isCancelled() method.
Case 2: Related source code Class: ReadingFragment Method: sendProgressUpdateToServer Circumstance The progress update sometimes delays too long to send to the server, which may cause the progress incorrect on next loading. Problem All the background works share one handler (_backgroundHandler). The background tasks are posted on one handler which means they have to run sequentially if multiple tasks are invoked simultaneously. _Suggested modification* Use a separate handler for progress updating.
The text was updated successfully, but these errors were encountered:
We are working on a project called PersisDroid (http://www.cudroid.com/PersisDroid/) for detecting potential performance issues. Our tool could find performance degradation caused by improper usage of asynchronous executions.
We find that in some cases your app may suffer a long processing delay.
Case 1:
Related source code Class: LoadOPDSTask Method: doInBackground
Circumstance Sometimes the network condition is poor. The user may switch activity before the OPDSfeed is obtained. The operation of request the feed should be cancelled as soon as possible.
Problem Some network request AsyncTasks are already cancelled but they are not stop immediately. These tasks may consume unnecessary network resource.
Suggested modification Check one more time whether the task is cancelled after the second network request via isCancelled() method.
Case 2:
Related source code Class: ReadingFragment Method: sendProgressUpdateToServer
Circumstance The progress update sometimes delays too long to send to the server, which may cause the progress incorrect on next loading.
Problem All the background works share one handler (_backgroundHandler). The background tasks are posted on one handler which means they have to run sequentially if multiple tasks are invoked simultaneously.
_Suggested modification* Use a separate handler for progress updating.
The text was updated successfully, but these errors were encountered: