From add2e51574bd13030100acffe38dedfb890b534a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Mar 2026 01:29:13 +0000 Subject: [PATCH 1/2] perf: cache Type.GetType calls in VerifyResultsetColumns Eliminates repeated Type.GetType reflection calls during result set verification by caching resolved types in a ConcurrentDictionary. Before: Type.GetType was called for every column in every result set on every query execution when runtime verification is enabled. After: Type resolution happens once per unique type name and is cached for subsequent queries. Impact: Significantly reduces reflection overhead in verification path, especially for queries with many columns or high execution frequency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/SqlClient/ISqlCommand.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SqlClient/ISqlCommand.fs b/src/SqlClient/ISqlCommand.fs index ec6b76a7..3d1151b8 100644 --- a/src/SqlClient/ISqlCommand.fs +++ b/src/SqlClient/ISqlCommand.fs @@ -127,6 +127,8 @@ type ``ISqlCommand Implementation``(cfg: DesignTimeConfig, connection: Connectio | unexpected -> failwithf "Unexpected ResultType value: %O" unexpected + static let typeCache = System.Collections.Concurrent.ConcurrentDictionary() + member this.CommandTimeout = cmd.CommandTimeout interface ISqlCommand with @@ -262,7 +264,8 @@ type ``ISqlCommand Implementation``(cfg: DesignTimeConfig, connection: Connectio invalidOp message for i = 0 to expected.Length - 1 do - let expectedName, expectedType = fst expected.[i], Type.GetType( snd expected.[i], throwOnError = true) + let expectedName, expectedTypeString = fst expected.[i], snd expected.[i] + let expectedType = typeCache.GetOrAdd(expectedTypeString, fun typeName -> Type.GetType(typeName, throwOnError = true)) let actualName, actualType = cursor.GetName( i), cursor.GetFieldType( i) if actualName <> expectedName || actualType <> expectedType then From a9cc0df4d0a84631b0bf8ce5d325b8857a90d43b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Mar 2026 01:32:24 +0000 Subject: [PATCH 2/2] ci: trigger checks