char ref (managed pointer) is cast to byte ref https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194...
Then it uses SpanHelpers.SequenceEqual for byte which is vectorized
https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194...
Then it uses SpanHelpers.SequenceEqual for byte which is vectorized
https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194...
To be clear, char is not cast to byte (which would truncate). A char ref (ie a char pointer) is cast to a byte ref (ie a byte pointer).