Skip to content

Generate fully qualified lambda signatures for better compilation speed #33773

Description

@roji

Especially in the compiled model, we currently generate lambdas which aren't fully qualified:

       activityTagPacketFrameRow.TypeMapping = SqlServerLongTypeMapping.Default.Clone(
                comparer: new ValueComparer<long>(
                    (long v1, long v2) => v1 == v2,
                    (long v) => v.GetHashCode(),
                    (long v) => v),
                keyComparer: new ValueComparer<long>(
                    (long v1, long v2) => v1 == v2,
                    (long v) => v.GetHashCode(),
                    (long v) => v),
                providerValueComparer: new ValueComparer<long>(
                    (long v1, long v2) => v1 == v2,
                    (long v) => v.GetHashCode(),
                    (long v) => v));

For better compilation, it is highly recommended to specify the return value of the lambdas, to avoid the need for inference:

// current 
(long v1, long v2) => v1 == v2;
// preferred
bool (long v1, long v2) => v1 == v2;

Raised by @jaredpar

Activity

  1. added this to the 9.0.0 milestone on May 21, 2024
  2. added a commit that references this issue on Jul 3, 2024
    a7b0cb1
  3. removed their assignment
    on Jul 3, 2024
  4. added 3 commits that reference this issue on Jul 3, 2024
    1af8af3
    1c1e19e
    7cb0b4d
  5. added a commit that references this issue on Jul 9, 2024
    4840bc3
  6. modified the milestones: 9.0.0, on Aug 21, 2024
  7. modified the milestones: , 9.0.0 on Oct 12, 2024
  8. added theissue type on Jun 15, 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

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions