Dar9586 / NClientV2

An unofficial NHentai android client
Apache License 2.0
1.9k stars 94 forks source link

[App Performance] Low Performance Issues #142

Closed hmaltr closed 4 years ago

hmaltr commented 4 years ago

When searching a manga or loading a page (main page) the app stops for 5-6 secs then continues as normal, before it was progressive and more responsive. Can you optimize it a little bit? Thanks.

hmaltr commented 4 years ago

Samsung A50 running Android 10

Dar9586 commented 4 years ago

I don't know if I fixed this by mistake, but testing on:

It didn't give me any performance issues, even using the performance analyzer of Android Studio, with version 2.3.5, if it continues being slow maybe it is the connection with the nhentai/nhent.ai site which is slow

hmaltr commented 4 years ago

Yes it was the connection but the app freezes and even android ANR appears. Can you make it progressive? Instead of waiting to load everything? Because browsing becomes impossible because of constant freezes

hmaltr commented 4 years ago

@Dar9586 what did you change 2.3.4? The app lags in the newer versions.

Dar9586 commented 4 years ago

In 2.3.4 Literally a line of code Commit (was made in order to fix #134) While in 2.3.3 there are 2 commits (Commit1, Commit2) The second commit only adds a function which is never used. The first commit instead mostly changes how the communication work when logged (adding favorite or login) now while the first commit. The cahnges in the MainActivity (which is the default and the one which is slow) are:

The only notable change has been:

But using both emulators and physical devices with both version I couldn't find any difference in speed/responsiveness using also an ultra slow connection (can be simulated using the emulator)

Dar9586 commented 4 years ago

Maybe I found the problem, [fixed APK]() this APK is the same of 2.3.8 but with a function disabled, maybe it could be the source of the problem. If it fixed the problem let me know and I will implement it in the next update

hmaltr commented 4 years ago

Yes it fixed the problem hopefully 😃

Dar9586 commented 4 years ago

The problem was caused from the more metadata of the gallery used for #126. When a gallery was loaded it search for the id, but the parsing required a lot of time, now it should be fixed, but still caching the images from local storage

hmaltr commented 4 years ago

The problem was caused from the more metadata of the gallery used for #126. When a gallery was loaded it search for the id, but the parsing required a lot of time, now it should be fixed, but still caching the images from local storage

Well at least its usable now :)