I have been working on visualizing government data through the Google Maps JS API. Currently, every time a user changes a filter value, the whole JSON dataset is fetched again, filtered, and new markers are generated for each valid row. This process seems slow as it downloads the JSON repeatedly whenever there is a change in the filter settings.
There are two possible ways to optimize data caching and dynamic display: either store the downloaded JSON once and manage markers based on filters or create all markers upfront and show only those that match the filters.
I am unsure about the performance impact of these two approaches. Both strategies make sense to me, but I need help evaluating which one would be more efficient. How can I determine the load imposed by displaying google maps markers on the user's system?