Skip to content

Performance of Trigonometric math function have unbelievable loss at .NET8 #95954

Closed
@kingsznhone

Description

@kingsznhone

Description

I have a compute program that have intense Trigonometric calculation.

I try to compile with .NET 8 . Then run a benchmark.

Compute speed drop more than 10 times more.

Configuration

OS: Windows 11 x64
Runtime: .NET 6 7 8

Data

20231213171827

Analysis

The function I use is (su,cu)= Math.SinCos(u);

It's faster than

su = Math.Sin(u);
cu = Math.Cos(u);

on .NET 6 & .NET 7

Then I change my code to

su = Math.Sin(u);
cu = Math.Cos(u);

Here is benchmark result.

20231213172355

I think there are some serious problem with internal implementation of Math.SinCos() method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions