Skip to content

SqlServer.Types is 20% slower on .NET 8 #96211

Closed
@jnyrup

Description

@jnyrup

Description

In #75455 (comment) I got help to diagnose that due to how SqlServer.Types calls native code, it runs much slower with W^X enabled.

With .NET 8 I re-ran my benchmarks with W^X disabled and saw a 20% regression compared to .NET 7.
STIntersection.zip

Do you have an idea what might have caused this performance regression and if it's "by design"?

Configuration

To make as fair a comparison between .NET 7 and .NET 8, I disabled Dynamic PGO, DATAS and W^X.

BenchmarkDotNet v0.13.10, Windows 10 (10.0.19045.3803/22H2/2022Update)
Intel Core i7-10750H CPU 2.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET SDK 9.0.100-alpha.1.23619.5
  [Host]     : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  Job-VCKSWC : .NET 7.0.14 (7.0.1423.51910), X64 RyuJIT AVX2
  Job-KIDGWI : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  Job-WWREOB : .NET 8.0.0 (8.0.23.11008), X64 RyuJIT AVX2
  Job-ROIKLT : .NET 9.0.0 (9.0.23.61807), X64 RyuJIT AVX2

EnvironmentVariables=DOTNET_GCDynamicAdaptationMode=0,DOTNET_EnableWriteXorExecute=0,DOTNET_TieredPGO=0,DOTNET_TieredCompilation=0,DOTNET_TC_QuickJit=0  Platform=X64  Server=True

Regression?

Yes.
The earliest .NET 8 runtime I could find was Preview1 which also had the regression.
If earlier runtime builds are available, I'd be happy to bisect this further.

Data

Method Runtime Mean Error StdDev Ratio RatioSD Code Size
STIntersection .NET 7.0 78.36 us 1.019 us 0.953 us 1.00 0.00 7,411 B
STIntersection .NET 8.0-Preview1 94.64 us 0.939 us 0.878 us 1.21 0.02 6,980 B
STIntersection .NET 8.0 96.58 us 1.565 us 1.675 us 1.23 0.03 7,377 B
STIntersection .NET 9.0 95.33 us 1.588 us 1.486 us 1.22 0.03 7,152 B

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions