-
Notifications
You must be signed in to change notification settings - Fork 1
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
Comments
converting the data to a hash table could achieve this but idk how to implement that or if its even possible on mongo |
alternatively we could store the JSON files locally but that might make it too big of a file |
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. |
@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! |
@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. |
@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! |
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.
The text was updated successfully, but these errors were encountered: