Skip to content

Move method info lookups to shared internal classes #20631

Closed as not planned
Closed as not planned

Description

Activity

  1. added this to the Backlog milestone on Apr 17, 2020
  2. added
    good first issue
    on Apr 17, 2020
  3. ajcvickers commented on Apr 17, 2020

    @ajcvickers
    Contributor

    Note to implementer:the main goal here is removal of duplicates. It may be better to leave single-access MethodInfos co-located with their use. It may also make sense to have multiple shared internal classes.

  4. modified the milestones: Backlog, MQ on Sep 11, 2020
  5. removed their assignment
    on Feb 12, 2021
  6. changed the title [-]Put method info lookups to shared internal class[/-] [+]Put method info lookups to shared internal classes[/+] on Jan 21, 2022
  7. changed the title [-]Put method info lookups to shared internal classes[/-] [+]Move method info lookups to shared internal classes[/+] on Jan 21, 2022
  8. nikhil197 commented on Aug 18, 2024

    @nikhil197

    Hi @ajcvickers / @smitpatel
    I would like to pick this one up if no one else is working on this one.
    I am thinking of creating separate shared classes, similar to EnumerableMethods for methods that are used in more than one places, like DateTime, DateOnly, string, etc. since they are being used in multiple places (in different providers SQLServer, SQLite, Cosmos db, etc).

  9. added a commit that references this issue on Aug 18, 2024
    114f3fb
  10. roji commented on Aug 19, 2024

    @roji
    Member

    @nikhil197 I believe this is no longer a direction we should go in.

    We currently indeed use reflection to look up MethodInfos; some of these patterns are understood by the .NET linker, which then refrains from trimming those methods. In effect, this means that EF's pipeline causes a lot more methods to get preserved, even if they never actually get used by user code, only because they could in theory be used and would need to be translated. This results in binaries that are bigger than they need to be.

    The alternative is to use string-based matching, where we look at the name of the method in the query pipline, and also at its DeclaringType. That refrains from directly referencing the method in a way that's visible to the linker.

    This work is tracked by #26288; I'll go ahead and close this issue.

  11. removed this from the MQ milestone on Aug 19, 2024
  12. added theissue type on Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-globalgood first issue

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions