NYTPhotoViewer icon indicating copy to clipboard operation
NYTPhotoViewer copied to clipboard

Lag and delay

Open sarambasich opened this issue 8 years ago • 4 comments

Abstract

Loading and using the photo viewer lib is subject to incredible amounts of lag and delay.

Steps to reproduce

  1. Load images asynchronously into a collection view controller as thumbnails
  2. Select a thumbnail
  3. Instantiate NYTPhotosViewController with valid NYTPhoto instances (3 in this case)
  4. Present the VC

Observed results

There is a 2-4 second delay between the time I select an image thumbnail in my collection view until the view controller is presented.

Additionally, while swiping between images, there is a significant 3-4 second delay.

Expected results

The view controller is presented immediately.

Swiping thru photos is seamless and smooth, incurs no delay.

Detail & Methodology

Project setup

  • Using Carthage for this dependency
  • Workspace: 2 iOS apps, 1 framework, Cocoapods project

Workflow

All images are downloaded asynchronously and stored in a view model (MVVM) before presentation to the user.

The images are already in existence as UIImage instances before NYTPhotosViewController is presented.

Data

Three images in question that cause this library to perform extremely poorly have the following byte sizes (as returned by HTTP Content-Length field):

  • 1667272
  • 2567293
  • 247022

I do not feel these are unreasonable sizes for the images.

Attempted workarounds

  • Using the latest release tag instead of the readme's given Cartfile entry
  • Storing a strong reference to NYTPhotosViewController on presenting view controller (aka reusing, not re-instantiating each time a thumbnail is tapped)

This lag makes this library unusable!

Can provide photos, videos upon request. Please advise, thank you.

sarambasich avatar Sep 08 '16 15:09 sarambasich

👍 Seeing and experiencing these same delays. Something seems off - shouldn't be this slow.

samgold89 avatar Sep 19 '16 01:09 samgold89

@ArtisOracle does your instance of NYTPhoto implement imageData property? In my case returning nil from this property helped. Please look at imageData property documentation in the NYTPhoto protocol for more details.

szymont avatar Oct 05 '16 14:10 szymont

+1

royherma avatar Feb 28 '17 09:02 royherma

Hi,

I have the same problem. Is there any solution? I have a delay of 2 or 4 seconds when I tap of a thumbnail.

jet-lee-m avatar Jul 26 '17 14:07 jet-lee-m