dotnet / jitutils

MIT License
144 stars 59 forks source link

Update for new categories of tiered compilation #383

Closed AndyAyersMS closed 11 months ago

AndyAyersMS commented 11 months ago

Fix instructions retired explorer to understand new categories of jitted code introduced in .NET 8.

Use proper event field rather than trying to decode flags.

Update trace event to a version with the new OptimizationTier values.

AndyAyersMS commented 11 months ago

@BruceForstall PTAL cc @dotnet/jit-contrib

Fixes some issues I ran into trying to run this on a new machine. For some reason the old way of parsing flags no longer worked, and this new way is cleaner anyways.

Also updates IRE to understand new categories of jitted code it might run across in .NET 8.

AndyAyersMS commented 11 months ago

Sample output (from an arm64 box) for JetStream.TimeSeriesSegmentation.MaximizeSchwarzCriterion.

Note there are 5 variants of SampleVarianceUpperTriangularMatrix..ctor active during benchmark intervals, including one at Tier0-0i.

Samples for corerun: 4548 events for Benchmark Intervals
Jitting           : 02.25% 7.4E+05  samples 1540 methods
  JitInterface    : 00.85% 2.8E+05  samples
Jit-generated code: 78.05% 2.56E+07 samples
  Jitted code     : 78.05% 2.56E+07 samples
  MinOpts code    : 00.00% 0        samples
  FullOpts code   : 00.00% 0        samples
  Tier-0 code     : 00.15% 5E+04    samples
  Tier-1 code     : 67.08% 2.2E+07  samples
  Tier-0 inst code: 00.12% 4E+04    samples
  Tier-1 inst code: 00.00% 0        samples
  R2R code        : 00.00% 0        samples

00.46%   1.5E+05     ?        Unknown
44.06%   1.447E+07   Tier-1   [MicroBenchmarks]Statistics.findOptimalSegmentationInternal(float32[][],int32[][],float64[],class JetStream.SampleVarianceUpperTriangularMatrix,int32)
22.87%   7.51E+06    Tier-1   [MicroBenchmarks]SampleVarianceUpperTriangularMatrix..ctor(float64[])
15.86%   5.21E+06    native   ucrtbase.dll
03.81%   1.25E+06    OSR      [MicroBenchmarks]Statistics.findOptimalSegmentationInternal(float32[][],int32[][],float64[],class JetStream.SampleVarianceUpperTriangularMatrix,int32)
03.56%   1.17E+06    OSR      [MicroBenchmarks]Statistics.findOptimalSegmentationInternal(float32[][],int32[][],float64[],class JetStream.SampleVarianceUpperTriangularMatrix,int32)
03.32%   1.09E+06    native   coreclr.dll
01.77%   5.8E+05     OSR      [MicroBenchmarks]SampleVarianceUpperTriangularMatrix..ctor(float64[])
01.55%   5.1E+05     OSR      [MicroBenchmarks]SampleVarianceUpperTriangularMatrix..ctor(float64[])
01.40%   4.6E+05     native   clrjit.dll
00.52%   1.7E+05     native   ntoskrnl.exe
00.27%   9E+04       native   ntdll.dll
00.15%   5E+04       Tier-1   [MicroBenchmarks]Statistics.splitIntoSegmentsUntilGoodEnough(float64[],float64)
00.12%   4E+04       Tier-0i  [MicroBenchmarks]SampleVarianceUpperTriangularMatrix..ctor(float64[])
00.09%   3E+04       Tier-0   [MicroBenchmarks]SampleVarianceUpperTriangularMatrix..ctor(float64[])
00.06%   2E+04       native   qcpep8280.sys