Found and fixed one major problem: The code already sorts all cells once. Just store the results and use them easily looked up later. Still the # of milliseconds per cell needed while writing goes up slightly with the # of cells to write. But it's much better now. See [20c5ed5f11].