damus
damus copied to clipboard
Fix frequent Kingfisher hang and other scrolling improvements
This PR should, hopefully, fix the hang that many users have been experiencing related to Kingfisher
Ref: note13j4kv0qc6eju03yc58kqhd00tuekc68z6pz8tk8y8y55l92c5rdslf9mw8
I believe the hang is caused when many images are queued for download from scrolling quickly; too many callbacks on the main thread at once, or network blocking? cancelOnDisappear will help for this.
According to KF docs line 98-101, backgroundDecode will also help eliminate scrolling hitches. IMPORTANT: If used, this option will have a significant impact on memory when downloading images. Older devices will crash while loading large files, even with a downsampler. If we decide to use this option, I recommend we implement #335 first.
- The accounts
npub1ea6y6er4n7vt9t5cxdf2p2jhp2ppga5texfmrma0xqj6t6frudaszaw8g5is following will help with testing older devices. Includes PFP and Banner for popular file types in small/medium/large/xlarge sizes.
Removed fade and loadDiskFileSynchronously as it impacts performance and doesn't make a noticeable UX difference.
Instruments Tests
Ran the following flow before and after changes
Results Before (Contains KFImage.ImageBinder hang)

Results After (Less frequent and shorter delays in hangs/hitches)

let's get #335 rebased and I'll merge these at the same time
this is huge, thank you. will test
merged this! let's merge 335 next