A Ryzen 5950X can do something like 5ghz * 4 IPC * 16 cores = 300 billion ops per second. Add SIMD on top of that. It's insane.
[1] https://cstheory.stackexchange.com/questions/9765/the-stalin...
T[]? toReturn = null;
var buffer = length <= threshold
? stackalloc T[threshold]
: (toReturn = ArrayPool<T>.Shared.Rent(length));
/* logic */
if (toReturn != null) ArrayPool<T>.Shared.Return(toReturn);
either directly or via a buffer-like type that does it behind the scenes.ArrayPool<T>.Shared is generally well-behaved in terms of GC, and small lengths will not even hit it, being practically free.
The amortized cost of this is substantially lower than allocating such arrays and then throwing them away: stackalloc, particularly for short lengths, is so cheap it might as well be noise, which is cheaper than still fast array alloc for short length, and as the length passes the threshold to avoid excessive stack pressure, it becomes faster to retrieve pre-allocated array from a threadlocal bucket within shared array pool.
Pretty much the same knowledge that applies to C/C++/Rust applies to C# in such scenarios, save for swapping auto-vectorization consideration with the one for simpler usage of Vector128/256/512<T> (which, in turns, applies to the use of intrinsics in both the former and the latter).