Chris Nicholas @chrisnicholas.dev · May 12

Decimals only work in theory. Floating point decimals runs out of precision after ~50 inserts at the end of the list, as you can see below. Storing indices as strings fixes that, but we've still got another problem—indices keep growing.

1 likes 1 replies

?

Replies

Chris Nicholas · May 12

Real apps push to the end of lists constantly, which causes new indices to balloon into long strings. At Liveblocks we use viewport-based growth—when the last item needs another digit, we jump by 3 chars and then increment by one. Indices stay tiny. 0.8 → 0.9 → 0.9001