isaachinman / wundershine-native-app

0 stars 0 forks source link

Longer queue select / deselect responsiveness is poor #115

Closed isaachinman closed 5 years ago

isaachinman commented 5 years ago

Describe the bug From Mick:

This is probably difficult/impossible to improve now, but with longer queues there is also a multi second lag with select / deselect.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

isaachinman commented 5 years ago

@Tintels I need your help on this one. Can you please provide some information as to how we can reproduce the problem (including demo accounts), and possibly a video of the delay happening?

Tintels commented 5 years ago

Long queue account bo@bo.nl PW Bo Short queue account so@so.nl PW So

On the iPad, Nokia 6.1 and the Nexus 5X the account with long queue takes and average of 3 to 4 seconds and the short queue account is well under a second. Obviously it would be great if you can make it both be under 1 second.

isaachinman commented 5 years ago

So, this actually comes down to Mongoose/MongoDB write speed. It turns out that the entire queue data structure is being written for each selection/deselection action.

For the bo@bo.nl account, there were 47 images in the deselected array, amounting to ~29kb of data being written with each action.

isaachinman commented 5 years ago

I've spent about 2 hours working on query optimisation. I am going to push this to the beta API and do some real-world testing, but there's an overwhelming chance what we're discussing here is premature optimisation.

isaachinman commented 5 years ago

This should be now fixed, with a combination of native and API performance enhancements.

isaachinman commented 5 years ago

3a3af7a

Tintels commented 5 years ago

Great stuff!