FredJul / Flym

Flym News Reader is a light Android feed reader (RSS/Atom)
Other
951 stars 405 forks source link

Enable strict mode and fix perf issues #686

Closed fireph closed 4 years ago

fireph commented 4 years ago

Strict mode allows you to see when stuff is running on UI thread that is long running (and various other issues that are related). This enables that and then fixes the major perf issues that were obvious once strict mode was turned on. All of the issues fixed are centered around trying to run disk reads off UI thread. This should dramatically reduce frame drops when scrolling on entries fragment.

I also ignore UntaggedSocketViolations since they are useless and will never be fixed in okhttp/glide

I tried testing as much of the app as I could to make sure switching these parts of the code to doAsync { ... } doesn't break anything, but a second set of eyes to make sure everything is still working would be great. 😃

before (red flashes are frame drops): 2020-09-22_15-09-44

after (no red flashes, no frame drops): 2020-09-22_15-10-29