Skip to content

Commit ffe9458

Browse files
committed
same results
1 parent 16b0f1d commit ffe9458

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

test/FastExpressionCompiler.Benchmarks/Issue468_Compile_vs_FastCompile.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)]
4453
public 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)]

test/FastExpressionCompiler.Benchmarks/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public static void Main()
2525

2626
//--------------------------------------------
2727

28-
BenchmarkRunner.Run<Issue468_Compile_vs_FastCompile>();
29-
// BenchmarkRunner.Run<Issue468_InvokeCompiled_vs_InvokeCompiledFast>();
28+
// BenchmarkRunner.Run<Issue468_Compile_vs_FastCompile>();
29+
BenchmarkRunner.Run<Issue468_InvokeCompiled_vs_InvokeCompiledFast>();
3030

3131
// BenchmarkRunner.Run<AccessByRef_vs_ByIGetRefStructImpl>();
3232

0 commit comments

Comments
 (0)