The Blazor Component Documentation advises that constant sequence numbers be used when building a custom RenderTree:
Generating the sequence numbers has lost all the useful information about where the if/else branches and loops were present in the original code. This results in a diff twice as long as before. ... In more realistic cases with complex and deeply nested structures, and especially with loops, the performance cost is more severe. Instead of immediately identifying which loop blocks or branches have been inserted or removed, the diff algorithm has to recurse deeply into the render trees and usually build far longer edit scripts because it is misinformed about how the old and new structures relate to each other.
So how does the Blazor compiler determine the sequence values for enumerated elements (i.e. elements repeated in a loop), given that the size of a collection cannot be determined at compile-time?