Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Possible causes of Hang-Bugs Found #84

@brok85

Description

@brok85

Dear SageMath Developers,
I am implementing a hang-bug detection tool and I am analyzing Sagemath with it (master version downloaded today). I tested the app with a Nexus 4 (Android 5.1) and Huawei P8 Lite (Android 4.4). I found that the main thread of SageMath calls:

  1. com.google.gson.Gson.toJson(Gson.java:509) and
  2. nl.qbusict.cupboard.DatabaseCompartment.put(DatabaseCompartment.java:331)

frequently when playing a script to plot a graph. In particular, the above APIs are called as consequence of the following call:

1) org.sagemath.droid.models.gson.InteractReply.toString(InteractReply.java:28) -> com.google.gson.Gson.toJson(Gson.java:509)

2) org.sagemath.droid.fragments.AsyncTaskFragment.query(AsyncTaskFragment.java:104) -> com.google.gson.Gson.toJson(Gson.java:509)

3) org.sagemath.droid.database.SageSQLiteOpenHelper.getCellbyID(SageSQLiteOpenHelper.java:390) -> nl.qbusict.cupboard.DatabaseCompartment.get(DatabaseCompartment.java:247)

In my experiments, the execution of those functions on the main thread may be the main cause of the eye-detectable delays (i.e., hang-bugs) experienced with SageMath.

As the developers guide of Android suggests, moving work off the main thread leads to higher responsiveness of the app. It is actually possible to move those two operations off the main thread using background threads. Therefore, do you think that the smoothness of the app would improve by executing those functions off the main thread?

Thanks for any information,
I hope I can help improve SageMath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions