Add UnsafeAccessor support for generic types#34146
Conversation
1af8af3 to
1c1e19e
Compare
|
@AndriySvyryd re removing Roslyn Formatter/Simplifier, can we first verify that these represent a significant part of the slowdown before removing them (/cc @maumar)? We of course don't have to produce nice code, but it's definitely a better if we can... |
|
Another question: I don't remember any more where we landed, but do we actually use the unsafe accessors generated by LinqToCSharpTranslator? IIRC we've got the unsafe accessors you generate in the compiled model, ideally we'd just use those in the interceptors rather than generate them again... |
| (InternalEntityEntry entry) => entry.ReadOriginalValue<int>(id, 0), | ||
| (InternalEntityEntry entry) => entry.ReadRelationshipSnapshotValue<int>(id, 0), | ||
| (ValueBuffer valueBuffer) => valueBuffer[0]); | ||
| int (InternalEntityEntry entry) => entry.ReadShadowValue<int>(0), |
There was a problem hiding this comment.
This change is great, but just asking (@maumar) - is the slowness in generating the code, or in compiling it? Because this change helps the latter rather than the former.
There was a problem hiding this comment.
I haven't had a chance to investigate this yet. Hopefully within next few days
This change makes pre-compiled query generation for |
We always use the unsafe accessors from the compiled model. There's an Assert checking that |
f87727b to
344cfc6
Compare
344cfc6 to
d53a4fd
Compare
... wow! |
roji
left a comment
There was a problem hiding this comment.
LGTM, but see comment about Generate/TryGenerate.
Fixes #33773
Fixes #33470