I found it. It's 11 years old and I can't say it was thoroughly tested but if if you look at the getClosestPoints() method, you can probably make out the algorithm and fix what needs it. Since you are more concerned with write speed than read speed, you can tweak when things happen. Of the top of my head is that you can increase the max points in a cell i.e. minimize the number of cells.