Skip to content

Commit 8b50bfb

Browse files
committed
Fix serialization performance: properties weren't being added to the property cache after being resolved
1 parent 0a03b3c commit 8b50bfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Nest/CommonAbstractions/Extensions/TypeExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ internal static IList<JsonProperty> GetCachedObjectProperties(this Type t, Membe
121121
if (_cachedTypeProperties.TryGetValue(t, out propertyDictionary))
122122
return propertyDictionary;
123123

124-
return _jsonContract.PropertiesOfAll(t, memberSerialization);
124+
var properties = _jsonContract.PropertiesOfAll(t, memberSerialization);
125+
_cachedTypeProperties.TryAdd(t, properties);
126+
return properties;
125127
}
126128

127129
}

0 commit comments

Comments
 (0)