The current naive implementation is about O(N^2) complexity; using union-find set could possibly get it to O(N) complexity.
There are two potential benefits: 1) faster warm up, and 2) move all computation to warm-up phase and thus get rid of the if ismissing(v) check in runtime (it's currently a cached lazy array) so as to better improve the perforamnce.