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

Make the loading images function faster (this should appear on page load) #41

Open
mrdbourke opened this issue Mar 23, 2022 · 2 comments

Comments

@mrdbourke
Copy link
Owner

Going to have to look into page loading times for this one.

I'd like the upload image function to be available as soon as the page loads.

Right now it's about a second or two behind the page itself.

Not a huge deal but experience wise, it could be better.

@shivan-s
Copy link

Would this involve some kind of async?

Upload image --> API --> Client has to wait until API is done processing the image.

Upload image --> Async --> API --> Client can keep uploading images while API is working in the background.

@mrdbourke
Copy link
Owner Author

Yes you're right.

(at least I think)

My JavaScript knowledge isn't too extensive so I'm winging this.

But basically right now the page loads:

  1. Text (HTML etc)
  2. Data - the entire Supabase database gets loaded into memory (because it's only ~100 rows) to enable fast querying - if this doesn't happen, the database gets queried with every image upload and takes ~2 seconds per query rather than 2 seconds at the start of the page load
  3. Models - these load fast since they're part of app itself (though a future test would be to see if pinging an API would be faster than using a model in the browser)

But because we load a few things at the start of the webpage, interacting with the "Upload image" button is ~1-2 seconds delayed, I'd rather this be almost instant.

So you can:

  1. Upload an image as soon as the page loads
  2. Everything else loads in the background whilst images are being uploaded
  3. The image gets loaded/prediction made simulataneously

All of the above happening so the experience is seamless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants