Points inserted in 7971.489929667s
Found 1725 stores in Le Vigan in 4.601183ms
Found 30942 stores in Nîmes in 12.080573ms
Found 298270 stores in Gard in 313.513845ms
Found 2454224 stores in Occitanie in 2.763677925s
2.7s is unacceptable.
Must be profiled to be sure, but a first optimization idea would be to guess the size of the queried shape and tile the query instead of the cells until the query takes more than like 6-10 cells.
Once that happens, it’s better to tiles the individual cells instead of the shape.
Points inserted in 7971.489929667s
Found 1725 stores in Le Vigan in 4.601183ms
Found 30942 stores in Nîmes in 12.080573ms
Found 298270 stores in Gard in 313.513845ms
Found 2454224 stores in Occitanie in 2.763677925s
2.7s is unacceptable.
Must be profiled to be sure, but a first optimization idea would be to guess the size of the queried shape and tile the query instead of the cells until the query takes more than like 6-10 cells.
Once that happens, it’s better to tiles the individual cells instead of the shape.