While refactoring BenchmarkDotNet to call benchmark methods directly instead of through a delegate (dotnet/BenchmarkDotNet#2334), I ran into an issue where the InProcessEmitToolchain is producing different results than the default toolchain. I disassembled it to try to figure out why it was different, and found the only difference is the call instruction.
Default toolchain
call qword ptr [BenchmarkDotNet.Autogenerated.Runnable_0.__Overhead()]
InProcessEmit
call BenchmarkDotNet.Autogenerated.Runnable_0.__Overhead()
It wouldn't really be an issue if the workload call also used the same call instruction, but it doesn't, so the overhead measurement is off.
call qword ptr [ActualWork.IncrementField()]
Is there any way I can make the asm match so we can get correct measurements?
call-direct-default-asm.md
call-direct-inprocess-asm.md
While refactoring BenchmarkDotNet to call benchmark methods directly instead of through a delegate (dotnet/BenchmarkDotNet#2334), I ran into an issue where the
InProcessEmitToolchainis producing different results than the default toolchain. I disassembled it to try to figure out why it was different, and found the only difference is the call instruction.Default toolchain
InProcessEmit
It wouldn't really be an issue if the workload call also used the same call instruction, but it doesn't, so the overhead measurement is off.
Is there any way I can make the asm match so we can get correct measurements?
call-direct-default-asm.md
call-direct-inprocess-asm.md