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

Fix long load times for map #55

Open
Wayne-Jones opened this issue Jun 16, 2020 · 6 comments
Open

Fix long load times for map #55

Wayne-Jones opened this issue Jun 16, 2020 · 6 comments

Comments

@Wayne-Jones
Copy link
Contributor

Load times for the map display seem to take about 4-5 seconds on average to retrieve back data. Need to figure out a way to cache already loaded data as well as just reducing the amount sent to the browser at once.

@Josh1794
Copy link
Contributor

converting the data to a hash table could achieve this but idk how to implement that or if its even possible on mongo

@Josh1794
Copy link
Contributor

alternatively we could store the JSON files locally but that might make it too big of a file

@Wayne-Jones
Copy link
Contributor Author

Wondering if slow load times was a result of us doing like millions of calls and we got throttled haha. We'll we should know tomorrow when the billing cycle resets.

@taylorcjohnson
Copy link

@Wayne-Jones Just saw you demo this on the MongoDB twitch stream (nice job!). Currently, it looks like all documents are being returned and then turned to markers and rendered on the map. One thing to examine could be try using a separate webhook and query for the map data that should be displayed in the map: MongoDB does have the concept of geospatial queries. Every time the map's extent changes you could fetch only the data within that extent. It would be a trade-off of more frequent requests vs smaller responses / fewer data points to render on the map. I am obviously missing a lot of background in your app, so that solution may not work for your team!

@Wayne-Jones
Copy link
Contributor Author

@taylorcjohnson Gotcha, we could probably do that. We can probably make data fetches depending what part of the map is currently rendered on the screen. And maybe have some way to cache it.

@taylorcjohnson
Copy link

@Wayne-Jones Yeah, if these datasets are not being updated caching seems the way to go. Once you get all of the documents from MongoDB, this technique might at least help render the Markers quicker: https://stackoverflow.com/a/54006851

It only includes points that are in the view area. Without running the application locally I'm not sure where the bottleneck is at the moment, but it looks like there are a few options to try!

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

3 participants