Skip to content

Commit 745b8ca

Browse files
authored
[Blazor] Use shared concurrent dictionary on the PersistentStateValueProvider serializer cache (#62661)
* Make _serializerCache static readonly to avoid creating dictionaries per instance on the PersistentStateValueProvider
1 parent c0b0121 commit 745b8ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Components/Components/src/PersistentStateValueProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal sealed class PersistentStateValueProvider(PersistentComponentState stat
1919
{
2020
private static readonly ConcurrentDictionary<(string, string, string), byte[]> _keyCache = new();
2121
private static readonly ConcurrentDictionary<(Type, string), PropertyGetter> _propertyGetterCache = new();
22-
private readonly ConcurrentDictionary<Type, IPersistentComponentStateSerializer?> _serializerCache = new();
22+
private static readonly ConcurrentDictionary<Type, IPersistentComponentStateSerializer?> _serializerCache = new();
2323

2424
private readonly Dictionary<ComponentState, PersistingComponentStateSubscription> _subscriptions = [];
2525

0 commit comments

Comments
 (0)