How to iterate over two collections in lockstep without heap allocations in C#
Enumerable.Zip allocates 144-208 bytes per call and runs about 10x slower than a plain loop. For arrays and lists, a for loop over two spans sliced to the same length is allocation-free and the fastest option; for foreach syntax, a small ref struct zip enumerator gets within 25% of it. Measured on .NET 10.0.10 and .NET 11 RC 3.