Skip to content

[Perf] Linux/arm64: 1 Regression in System.Tests.Perf_Int128 #104739

Closed

Description

@performanceautofiler

Run Information

Name Value
Architecture arm64
OS ubuntu 22.04
Queue AmpereUbuntu
Baseline 9882188fbe16adee3538b65a3926465dfd6052c1
Compare 6c553628dfaec02e665a4ade3deabe3a91281024
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Regressions in System.Tests.Perf_Int128

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio
133.94 ns 150.39 ns 1.12 0.04 False

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

git clone https://github.com/dotnet/performance.git
python3 .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Tests.Perf_Int128*'
Details

System.Tests.Perf_Int128.TryFormat(value: 170141183460469231731687303715884105727)

ETL Files

Histogram

JIT Disasms

Docs

Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository

Activity

  1. added
    os-linux
    runtime-coreclr
    untriaged
    on Jul 11, 2024
  2. removed
    untriaged
    on Jul 11, 2024
  3. ghost added
    needs-area-label
    on Jul 11, 2024
  4. added
    untriaged
    on Jul 11, 2024
  5. LoopedBard3 commented on Jul 11, 2024

    @LoopedBard3
    Member

    Likely caused by #104506.

  6. LoopedBard3 commented on Jul 11, 2024

    @LoopedBard3
    Member
  7. changed the title [-][Perf] Linux/arm64: 1 Regression on 7/9/2024 9:15:09 PM[/-] [+][Perf] Linux/arm64: 1 Regression in System.Tests.Perf_Int128[/+] on Jul 11, 2024
  8. EgorBo commented on Jul 11, 2024

    @EgorBo
    Member

    I think we should just revert that change then since there were no improvemens from it, only regressions

  9. stephentoub commented on Jul 11, 2024

    @stephentoub
    Member

    Do we know why it regressed?

  10. EgorBo commented on Jul 11, 2024

    @EgorBo
    Member

    I bet it has something to do with struct promotion, it's nice to see safe code to be faster than unnecessary unsafe

    @EgorBot -arm64 -perf -commit 8d231b4 vs 01dbf51 --disasm

    using BenchmarkDotNet.Attributes;
    
    public class Perf_Int128
    {
        private char[] _destination = new char[Int128.MinValue.ToString().Length];
    
        public static IEnumerable<object> StringValues => Values.Select(value => value.ToString()).ToArray();
    
        public static IEnumerable<object> Values => [Int128.MaxValue];
    
        [Benchmark]
        [ArgumentsSource(nameof(Values))]
        public bool TryFormat(Int128 value) => value.TryFormat(new Span<char>(_destination), out _);
    }
  11. EgorBot commented on Jul 11, 2024

    @EgorBot
    Benchmark results on Arm64
    BenchmarkDotNet v0.13.12, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
    Unknown processor
      Job-LWPCIP : .NET 9.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
      Job-KOCEMQ : .NET 9.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
    
    Method Toolchain value Mean Error Ratio Code Size
    TryFormat Main 17014(...)05727 [39] 133.6 ns 0.02 ns 1.00 2,172 B
    TryFormat PR 17014(...)05727 [39] 150.7 ns 0.03 ns 1.13 2,656 B

    BDN_Artifacts.zip

    Flame graphs: Main vs PR 🔥
    Hot asm: Main vs PR
    Hot functions: Main vs PR

    For clean perf results, make sure you have just one [Benchmark] in your app.

  12. 3 remaining items

  13. stephentoub commented on Jul 11, 2024

    @stephentoub
    Member

    Regardless of what we do here, can we please re-investigate having AggressiveInlining mean "for the love of all that is good in this world always inline this if it's physically possible" so we stop having these cases where inlining budget means tiny helpers stop being inlined?

    Unfortunately, it's not a solution, we may inline all AggressiveInlining and then stop inlining various Span.op_Implicit inside them and other APIs which are currently don't have AggressiveInlining, instead, we should've given up on a large method so everything inside of it had more chances to inline, etc.

    It's not a solution even if things marked AggressiveInlining don't consume any inlining budget?

  14. EgorBo commented on Jul 11, 2024

    @EgorBo
    Member

    It's not a solution even if things marked AggressiveInlining don't consume any inlining budget?

    Correct, imagine you have method A (root) and you inline stuff into it. You already inlined a lot and consumed 95% of your buget, then, you encounter this big method B with AggressiveInlining on it and inline it without reducing the budget - boom - you have no budget to inline any calls inside of it, even fairly trivial ones since you only have 5% (maybe for just one)

    cc @AndyAyersMS

  15. added and removed
    needs-area-label
    on Jul 15, 2024
  16. dotnet-policy-service commented on Jul 15, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-numerics
    See info in area-owners.md if you want to be subscribed.

  17. added this to the 9.0.0 milestone on Jul 20, 2024
  18. added
    needs-further-triage
    and removed
    untriaged
    on Jul 20, 2024
  19. jeffhandley commented on Aug 12, 2024

    @jeffhandley
    Member

    I think we should just revert that change then since there were no improvemens from it, only regressions

    @stephentoub -- Any objections to reverting Use Unsafe.BitCast for Int128 ↔UInt128 operators (#104506)?

  20. stephentoub commented on Aug 12, 2024

    @stephentoub
    Member

    I think it's better to revert it than trying to fix the "unsafe" variant.

    Let's do both. We can revert for now to undo the regression, but we shouldn't need to second guess ourselves when using Bitcast.

  21. removed their assignment
    on Aug 15, 2024
  22. added
    in-pr
    on Aug 15, 2024
  23. locked and limited conversation to collaborators on Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm64area-System.Numericsin-prneeds-further-triageos-linuxruntime-coreclr

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions