Skip to content

Commit 7821ac5

Browse files
committed
Fix performance degradation in converters because the instance was not reused.
1 parent 10bccc5 commit 7821ac5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/EFCore/Storage/Json/JsonConvertedValueReaderWriter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,8 @@ public override Expression ConstructorExpression
5555
=> Expression.New(
5656
_constructorInfo,
5757
((ICompositeJsonValueReaderWriter)this).InnerReaderWriter.ConstructorExpression,
58-
((IJsonConvertedValueReaderWriter)this).Converter.ConstructorExpression);
58+
// We shouldn't quote converters, because every new instance will have to compile
59+
// the expression again and it will have a negative performance impact.
60+
// This means this is currently unsupported scenario for precompilation.
61+
Expression.Constant(((IJsonConvertedValueReaderWriter)this).Converter));
5962
}

0 commit comments

Comments
 (0)