Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Query/Perf: don't compile liftable constant resolvers in interpretation mode when the resolver itself contains a lambda #35208

@maumar

Description

@maumar

This is part of a bigger perf regression between EF8 and EF9: #35053

When processing LiftableConstantExpressions in the regular (non-AOT) mode we compile the resolver lambda and then evaluate it to get back the actual constant we plan to use. We do the compilation in the interpretation mode and that causes problems if the resulting object is itself (or contains) a delegate. Compiling into a delegate using interpreted mode, has impact on allocations as well as execution speed.

before the fix (this already includes the invoke fix #35206)

Method Async Mean Error StdDev Op/s Gen0 Gen1 Allocated
MultiInclue False 487.1 ms 0.99 ms 0.88 ms 2.053 17000.0000 11000.0000 103.29 MB
MultiInclue True 487.4 ms 3.63 ms 3.22 ms 2.052 17000.0000 11000.0000 103.29 MB

after the fix

Method Async Mean Error StdDev Op/s Gen0 Gen1 Allocated
MultiInclue False 455.1 ms 8.94 ms 10.29 ms 2.197 11000.0000 6000.0000 67.92 MB
MultiInclue True 435.4 ms 1.77 ms 1.66 ms 2.297 11000.0000 6000.0000 67.92 MB

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions