Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple fix to speed up dataset gallery #3480

Merged
merged 2 commits into from
Nov 21, 2018
Merged

Conversation

daniel-wer
Copy link
Member

This is a very simple proposal to speed up the dataset gallery page for instances with a single organization. Previously in that case, all datasets (and their thumbnails) were shown and we thought about implementing pagination and/or viewport dependent rendering.
Now, when loading the page only the first 6 datasets are shown. A "Show more" link can be clicked to show all datasets (same as in the multiple-organizations-case, as on demo.webknossos).
I would argue that this alone will result in a decrease in server load as in most cases not all thumbnails are loaded. The search box still searches through all datasets and works as before.

If users complain about having to click that button or are doing it very often, we can always implement viewport dependent rendering later, I'd say :)

/cc @fm3

URL of deployed dev instance (used for testing):

Steps to test:

  • Open the gallery dataset view. Clicking "Show More" should show all datasets. Even having not clicked on "Show More", all datasets should be searchable.

Issues:


@jfrohnhofen
Copy link
Contributor

Regarding reducing pressure on the backend: The thumbnails have been / should be cached. So this should not really affect the server much in a production setup. Maybe the caching in the backend is broken causing the long loading times in the first place?

@daniel-wer
Copy link
Member Author

Could very well be, but still, requesting ~266 thumbnails (on master), each around 200kb in size is not really necessary, let's save some bandwidth :) I think most of the times, this view is opened to search through the existing datasets (which is still possible) or by accident or because it's the default tab.

@jfrohnhofen
Copy link
Contributor

Yes, sure. I did not want to discredit your PR, just in addition this is something we should check.

@daniel-wer
Copy link
Member Author

I fully agree with you :)

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent fix 👍 Very elegant and effective!

@philippotto philippotto merged commit fcb0792 into master Nov 21, 2018
@fm3
Copy link
Member

fm3 commented Nov 21, 2018

Cool stuff, thanks!
Regarding the back-end cache, I checked it recently when we first spoke about this performance issue, and it works still. However, the mhlab instance is frequently updated (restarted), resetting this cache, so the case of re-creating all thumbnails was not actually that rare. Also, sending hundreds of not-so-small images at the same time is not nothing, even if they are already in the cache.

@fm3 fm3 deleted the speed-up-spotlight branch November 21, 2018 22:11
@jfrohnhofen
Copy link
Contributor

@fm3 Thanks for checking!

jfrohnhofen added a commit that referenced this pull request Nov 23, 2018
* origin/master:
  Optimize performance for the list request /api/datasets (#3441)
  add annotation dataset foreign key  (#3482)
  thumbnails: correctly use zoom value if specified (#3487)
  Store Meshes in Postgres (#3367)
  fix alpha return (#3483)
  Added script to apply all new evolutions (#3427)
  Simple fix to speed up dataset gallery (#3480)
  better errors for screenshot tests, fix imports, refresh screenshots (#3479)
  (Backend only) Add project priority to progress report json (#3476)
  Handle missing write access on datastore (#3411)
  Re-introduce "Flightmode improvements"" (#3473)
  Circleci-notify: linkify PR number (#3469)
  Revert "Flightmode improvements" (#3472)
  also flow-ignore binaryData when using symlinks (#3471)
  Flightmode improvements (#3392)
  Circleci custom notification (#3465)
  enable /api/switch cross-organization (#3464)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paginate Dataset Gallery
4 participants