From c3bfee4d8561f1187219b6894eb838fbfba9ff27 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 14:56:38 +0000 Subject: [PATCH 1/2] Initial plan From ccd7684024350fe8f9d466ef63a622a72b629f0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 15:07:59 +0000 Subject: [PATCH 2/2] Make _serializerCache static readonly to avoid creating dictionaries per instance Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com> --- src/Components/Components/src/PersistentStateValueProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Components/src/PersistentStateValueProvider.cs b/src/Components/Components/src/PersistentStateValueProvider.cs index 669e0b5a5363..6fd758f38ba4 100644 --- a/src/Components/Components/src/PersistentStateValueProvider.cs +++ b/src/Components/Components/src/PersistentStateValueProvider.cs @@ -19,7 +19,7 @@ internal sealed class PersistentStateValueProvider(PersistentComponentState stat { private static readonly ConcurrentDictionary<(string, string, string), byte[]> _keyCache = new(); private static readonly ConcurrentDictionary<(Type, string), PropertyGetter> _propertyGetterCache = new(); - private readonly ConcurrentDictionary _serializerCache = new(); + private static readonly ConcurrentDictionary _serializerCache = new(); private readonly Dictionary _subscriptions = [];