Skip to content

Consider using the preview Interceptors feature instead of post-build patching for IIDOptimizer #1420

@jkoritzinsky

Description

@jkoritzinsky

Today, calls to GuidGenerator.GetIID are optimized into constant or partially pre-calculated values after compilation with IL editing. The C# compiler has an experimental feature to intercept calls by callsite and replace them with calls to other methods. This feature is in preview, but is used by various source generators for ASP.NET Core and Microsoft.Extensions projects. It may be worth moving IIDOptimizer to be a source-generator that emits the pre-calculated code to avoid getting into situations where it emits code that uses non-optimal patterns (#1340)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions