Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing disassembly on .NET 9 #2638

Closed
MihaZupan opened this issue Sep 13, 2024 · 2 comments · Fixed by #2488
Closed

Missing disassembly on .NET 9 #2638

MihaZupan opened this issue Sep 13, 2024 · 2 comments · Fixed by #2488
Assignees
Milestone

Comments

@MihaZupan
Copy link
Member

Running the following benchmark

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using System.Buffers;

BenchmarkRunner.Run<Test>(args: args);

[DisassemblyDiagnoser(10)]
[ShortRunJob(RuntimeMoniker.Net80)]
[ShortRunJob(RuntimeMoniker.Net90)]
public class Test
{
    private static readonly SearchValues<char> s_values = SearchValues.Create("aeiouAEIOU");
    private static readonly string s_text = new('\n', 1000);

    [Benchmark]
    public void ContainsAny() => s_text.AsSpan().ContainsAny(s_values);
}

will print something like

| Method      | Job               | Runtime  | Mean     | Error    | StdDev   | Code Size |
|------------ |------------------ |--------- |---------:|---------:|---------:|----------:|
| ContainsAny | ShortRun-.NET 8.0 | .NET 8.0 | 12.89 ns | 4.731 ns | 0.259 ns |     566 B |
| ContainsAny | ShortRun-.NET 9.0 | .NET 9.0 | 11.86 ns | 0.263 ns | 0.014 ns |      55 B |

(.NET 8.0.8 and 9.0 RC 1)

where the disassembly for .NET 9 is just the top-most benchmarked method, calling into something, but the callee isn't included.

; Test.ContainsAny()
       sub       rsp,28
       mov       r8,237BFC003E8
       mov       rcx,[r8]
       add       rcx,0C
       mov       r8,237BFC003E0
       mov       r8,[r8]
       add       r8,8
       mov       edx,3E8
       call      qword ptr [7FFC211FE700]
       nop
       add       rsp,28
       ret
; Total bytes of code 55

I'm sure this used to work earlier in .NET 9, so it's possible a change in .NET broke this.

@timcassell
Copy link
Collaborator

Fixed by #2488

@timcassell timcassell self-assigned this Sep 14, 2024
@timcassell timcassell linked a pull request Sep 14, 2024 that will close this issue
@MihaZupan
Copy link
Member Author

Thank you. I'm using a local build of that change now, looks like it's working as expected.

@timcassell timcassell added this to the v0.14.1 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants