-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Milestone
Description
JIT could replace virtual, interface and delegate dispatch with static one when it knows the target at jit-time. JIT could even inline it when appropriate.
private static readonly EqualityComparer<T> eqCmpr = EqualityComparer<T>.Default;
private static readonly IComparer<T> cmpr = CreateComparer();
private static readonly Func<T, T, bool> funcCmpr = CreateDelegateComparer();
private void HappenedToBeJittedFirst(T x, T y)
{
eqCmpr.Equals(x, y);
}
private void LuckyOne(T x, T y)
{
eqCmpr.Equals(x, y);
}
category:cq
theme:devirtualization
skill-level:expert
cost:medium
GSPPpentp
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue