Nearly every mapping application will use "data points" that contain latitude and longitude values. So why not use the latitude and longitude values as input into a clusterer rather than spending time creating Google map markers for use as input? The majority of the individual map markers created are never displayed, which is a waste of memory.
In this example, we compare the time required to create "data_point" objects vs creating Google map markers. The example illustrates the performance gain by omitting the need to create Google map markers as input to a clusterer.
Note we do not display any markers on a map, as we are only measuring the time to create them.
- Each test allocates an array with a size equal to the number of random (latitude / longitude) points to create and then populates the array with that number of objects (i.e.: either "data_point" objects or Google map marker objects). The total time is then displayed.
- Warning: Creating more than 400,000 google map markers will likely cause your browser to hang, (at least it does on my workstation), the limit will vary depending on your workstation hardware.