Skip to content

Intermittently long waiting time for search result to be displayed #86

Open
@perfprobe

Description

Dear developers,

We are applying our performance diagnosis tool PerfProbe to debug the user-experienced latency for searching for songs by some keyword (see "Steps to reproduce" below) in the Tomahawk Android app and observe that sometimes the latency increase to around 5 seconds and to 15.8 seconds in the worst case (on average around 1 second in my setup). Through its system-wide profiling and tracing, PerfProbe discovers that the source of extra delay results from longer execution time in the system API method libcore/io/Posix.poll (for example, one invoked by org/tomahawk/libtomahawk/infosystem/hatchet/HatchetInfoPlugin.getParseConvert -> retrofit/client/OkClient.execute -> com/squareup/okhttp/Call.getResponse -> java/net/Socket.connect), possibly caused by longer waiting time for server-side web responses.

Through inspecting TomaHawk's logcat messages and source code, we find that exceptions are frequently thrown ("java.net.SocketTimeoutException: failed to connect to api.hatchet.is/144.76.89.227 (port 443) after 10000ms" and "java.lang.IllegalArgumentException: Path parameter "id" value must not be null."). We suspect that the UI update of SearchPagerFragment (defined in app/src/main/java/org/tomahawk/tomahawk_android/fragments/SearchPagerFragment.java) is dependent on the return of web responses (through its callback method onEventMainThread), while the web requests seem to fail all the time. As a result, the UI update time is also dependent on when the exceptions are thrown.

We hope our findings can be helpful for your problem debugging and fixing. Please confirm if they are consistent to the app implementation. We are also interested in helping fixing the performance of this interaction. Thank you very much for your attention and clarification!

Related issues: 77, 74

Expected behavior

Consistent latency for displaying the search result

Actual behavior

Intermittently increase of delay for displaying the search result

Steps to reproduce

  1. Click Menu icon
  2. Click "CHARTS"
  3. Click Search icon
  4. Enter some words in the text box (e.g., mama)
  5. Click Search button on the key pad

Environment

Tomahawk version: 0.986_armeabi-v7a from Google Play
Android version: Android 4.4.4
Device: Nexus 4

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