dotnet / dotnet/BenchmarkDotNet

DisassemblyDiagnoser does not show asm of called delegate

Open
#672 2 comments 0 reactions 1 assignee Claimed by @adamsitnik View on GitHub
Area:Diagnosers blocked
Dominant language
C#
Stars
11.5k
Forks
1.1k
Avg merge
4d 11h
Merged PRs (30d)
11

Description

Here is simplified benchmark on .NET Core, but I have similar results on Full CLR:

[DisassemblyDiagnoser(recursiveDepth: 100)]
public class CallDelegate
{
private static readonly Func _showTime = () => "Now is: " + DateTime.Now;

[Benchmark(Baseline = true)]
public object Direct() => "Now is: " + DateTime.Now;

[Benchmark]
public object CallFunc() => _showTime();
}

Here is the results:

![image](https://user-images.githubusercontent.com/39516/36933574-8521a9d8-1eec-11e8-836f-97e9184c14a7.png)

Here is the asm `CallDelegate_CallFunc_DefaultJob-asm.raw.html`

```

00007ffb`7f260e10 FastExpressionCompiler.Benchmarks.Program+CallDelegate.CallFunc()
00007ffb`7f260e14 48b928162d7ffb7f0000 mov rcx,7FFB7F2D1628h
00007ffb`7f260e1e ba2d000000 mov edx,2Dh
00007ffb`7f260e23 e82846ad5f call coreclr!MetaDataGetDispenser+0x73970 (00007ffb`ded35450) not managed method
00007ffb`7f260e28 48b9586d45725e020000 mov rcx,25E72456D58h  
00007ffb`7f260e32 488b01 mov rax,qword ptr [rcx]  
00007ffb`7f260e35 488b4808 mov rcx,qword ptr [rax+8]  
00007ffb`7f260e39 488b4018 mov rax,qword ptr [rax+18h]
```

The asm for `Direct` benchmark is a very long (`recursiveDepth: 100`)

__BTW__, My original benchmark target was https://github.com/dadhi/FastExpressionCompiler/blob/master/test/FastExpressionCompiler.Benchmarks/SimpleExpr_ParamPlusParam.cs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.