danzel/Leaflet.markercluster — pull request #29 by mourner (2012-08-09 13:42:32+00:00)
Title: Improve performance 4-20 times with grid-based near neighbor search

It worked, hooray! Not as optimistic as I thought in #28 but still an awesome improvement. Final clustering result is not exactly the same but that's just because of different point processing order, generally it works the same, didn't notice any flaws. Some sample tests for initial clustering time on the 50000 example, using Chrome 21 and Firefox 14:

Chrome:
New: 480ms
Old: 2052ms

Firefox:
New: 1465ms
Old: 24664ms (without "script is running too long" popups, appear 2-3 times if not disabled)

Turns out memory consumption improved by 1.5 times as well:

Chrome Heap Snapshot:
New: 28.52MB
Old: 47.48MB