diff --git a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs index e66190e200a3..ebe006ed0bb7 100644 --- a/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs +++ b/src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs @@ -1036,7 +1036,9 @@ private async IAsyncEnumerable CastIAsyncEnumerable(string methodName, obj for (var i = 0; i < args.Length; i++) { var arg = args[i]; - if (arg is not null && ReflectionHelper.IsStreamingType(arg.GetType())) + // Primitives, strings, enums, DateTime and decimal can never be streams, skip the reflection check + // for them since it allocates (Type.GetInterfaces) for every argument on every send. + if (arg is not null && Type.GetTypeCode(arg.GetType()) == TypeCode.Object && ReflectionHelper.IsStreamingType(arg.GetType())) { isStreaming[i] = true; newArgsCount--;