@@ -36,10 +36,19 @@ .NET SDK 9.0.203
3636| InvokeCompiledFast | .NET 9.0 | .NET 9.0 | 1.0640 ns | 0.0539 ns | 0.0929 ns | 1.0106 ns | 1.01 | 0.12 | 2 | 2 | 0 | 0 | - | NA |
3737| InvokeCompiled | .NET 9.0 | .NET 9.0 | 0.5897 ns | 0.0451 ns | 0.0858 ns | 0.6156 ns | 0.56 | 0.09 | 1 | 1 | -0 | -0 | - | NA |
3838
39+ ## Steal the same speed with the minimal IL of 2 instructions
40+
41+ Job=.NET 8.0 Runtime=.NET 8.0
42+
43+ | Method | Mean | Error | StdDev | Ratio | RatioSD | Rank | Allocated | Alloc Ratio |
44+ |------------------- |----------:|----------:|----------:|------:|--------:|-----:|----------:|------------:|
45+ | InvokeCompiled | 0.4647 ns | 0.0321 ns | 0.0268 ns | 1.00 | 0.08 | 1 | - | NA |
46+ | InvokeCompiledFast | 0.9739 ns | 0.0433 ns | 0.0481 ns | 2.10 | 0.15 | 2 | - | NA |
47+
3948*/
4049[ MemoryDiagnoser , RankColumn ]
41- [ HardwareCounters ( HardwareCounter . CacheMisses , HardwareCounter . BranchMispredictions , HardwareCounter . BranchInstructions ) ]
42- [ SimpleJob ( RuntimeMoniker . Net90 ) ]
50+ // [HardwareCounters(HardwareCounter.CacheMisses, HardwareCounter.BranchMispredictions, HardwareCounter.BranchInstructions)]
51+ // [SimpleJob(RuntimeMoniker.Net90)]
4352[ SimpleJob ( RuntimeMoniker . Net80 ) ]
4453public class Issue468_InvokeCompiled_vs_InvokeCompiledFast
4554{
@@ -50,7 +59,7 @@ public void Setup()
5059 {
5160 var expr = IssueTests . Issue468_Optimize_the_delegate_access_to_the_Closure_object_for_the_modern_NET . CreateExpression ( ) ;
5261 _compiled = expr . CompileSys ( ) ;
53- _compiledFast = expr . CompileFast ( ) ;
62+ _compiledFast = expr . CompileFast ( flags : CompilerFlags . EvaluateExpressionIfPossible ) ;
5463 }
5564
5665 [ Benchmark ( Baseline = true ) ]
0 commit comments