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

ReadyToRun images are not as efficient for .NET Core 3 as NGen for .NET Framework #13339

Open
grubioe opened this issue Aug 29, 2019 · 56 comments
Assignees
Labels
Milestone

Comments

@grubioe
Copy link

grubioe commented Aug 29, 2019

@AlexChuev commented on Thu Aug 29 2019

  • .NET Core Version: 3.0 Preview 8
  • Windows version: 1809
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: No
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No

Problem description:
Since Ngen.exe and Native Image Task are not available in .NET Core 3, ReadyToRun images are the only way to reduce the application startup time and avoid delays caused by JIT compilation. However, our tests show that for the same WPF application that initializes three times faster after using Ngen.exe, ReadyToRun images provide the difference of only 25%.
This is a huge hit for our users, since with many libraries and theme resources, JIT compilation is one of the main factors affecting load times. For some real-life applications, the use of Ngen.exe allowed our users to shave up to 6 seconds (half) off the initial start time.

Minimal repro:
You can find samples for .NET Core 3 and .NET Framework here: https://github.com/AlexChuev/ReadyToRunPerformanceTest
These samples use DevExpress WPF assemblies to demonstrate how Ngen.exe and ReadyToRun images affect projects with many classes and theme resources. If you need published apps or other samples for your tests, please let me know.

P.S. I'm posting this in the WPF repo because the difference between Ngen.exe and ReadyToRun images highly affects WPF applications. Normally, the JIT compiler processes classes and methods only when they are needed for the program execution. However, when WPF loads theme resources for a control, this causes all classes referenced in these resources (including classes referenced in currently unused or invisible parts) to be processed by the JIT compiler. In addition, static constructors of many WPF classes contain the DependencyProperty registration code that may cause even more classes and methods to be JITted.


@rladuca commented on Thu Aug 29 2019

@fadimounir Where should we file a companion bug on .NET?


@fadimounir commented on Thu Aug 29 2019

@rladuca Sure you can file a companion bug on dotnet/coreclr. We'd be interested in diagnosing this more, although one thing to keep in mind is that R2R by design principle will always be a bit slower than fragile native images, because they are version resilient (they do not have the same fragility as old ngen images).

If you need published apps or other samples for your tests, please let me know.

@AlexChuev That would be very helpful

cc @jkotas FYI

@grubioe
Copy link
Author

grubioe commented Aug 29, 2019

Copied from WPF issue #1478

@EgorBo
Copy link
Member

EgorBo commented Aug 29, 2019

COMPlus_TC_QuickJitForLoops=1 slightly improved startup time for my hand made UI app (even with full R2R).

@AlexChuev
Copy link

AlexChuev commented Sep 2, 2019

@fadimounir You can find published samples here:
https://devexpress-my.sharepoint.com/:u:/p/alexander_chuyev/EfQCpVoz181Nj61vjW-N1Q4BjgXkVMHMOXnzIym4bXQvYg?e=4iMy56
The source code for these samples is here:
https://github.com/AlexChuev/ReadyToRunPerformanceTest

Results that I get on my test machine:

Application Time to load assemblies
.NET Core (self-contained, no r2r) 680 ms
.NET Core (self-contained, with r2r) 450 ms
.NET Framework (no native images) 1000 ms
.NET Framework (with native images) 250 ms

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@Bigous
Copy link

Bigous commented Jul 7, 2020

Do we have any progress or some workaround to this?

@SirBogman
Copy link

Related issue: dotnet/fsharp#9061

@elachlan
Copy link
Contributor

@AlexChuev is it possible for you to run another test using the lastest .NET 5 Preview? There is a very recent blog post about performance as well (https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/). Although it doesn't mention any improvements to ReadyToRun other than size reduction, there is a lot of changes in JIT though.

@AlexChuev
Copy link

@elachlan here are my results for the same test app converted to .NET 5 and targeting x64:

Application Time to load assemblies
.NET Framework (no native images) 1448
.NET Framework (with native images) 277
.NET Core 3 (self-contained, no r2r) 957
.NET Core 3 (self-contained, with r2r) 586
.NET 5 (self-contained, no r2r) 1104
.NET 5 (self-contained, with r2r) 708

.NET 5 is slower than .NET Core 3 in my tests, to which I have no explanation so far. Note that I had to use a different machine than previously, so total numbers are a bit different.

@elachlan
Copy link
Contributor

@AlexChuev thanks for the tests. Not so great that we have gone backwards again.

@stephentoub Your article was a great run down of the performance improvements and was much appreciated. There was a comment on it that Preview 7 was going to have more improvements for AOT/R2R. Is that the intention?

Based on Alex's tests, .NET 5 looks like its 155% worse than .NET Framework and 20% worse than .NET Core 3.

Thanks!

@stephentoub
Copy link
Member

Your article was a great run down of the performance improvements and was much appreciated.

Thanks.

There was a comment on it that Preview 7 was going to have more improvements for AOT/R2R.

Which comment?

@elachlan
Copy link
Contributor

There was a comment on it that Preview 7 was going to have more improvements for AOT/R2R.

Which comment?

Sorry, someone made a comment, in the comments. Not you specifically.
https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/#comment-6772

I imagine there will be some sort of effort before release, just wondering if that was the aim.

@stephentoub
Copy link
Member

I see, thanks. @jeffschwMSFT may be able to provide more information.

@jeffschwMSFT
Copy link
Member

Adding @mangod9 and @jkotas. We are aware that there are performance gaps between r2r and ngen. One of the larger positive factors of r2r is the less fragile nature of its images, which comes with a performance trade mark. The way that we like to approach these problems are with real world examples that we can take a look at and tune.

@SirBogman
Copy link

We are aware that there are performance gaps between r2r and ngen. One of the larger positive factors of r2r is the less fragile nature of its images, which comes with a performance trade mark. The way that we like to approach these problems are with real world examples that we can take a look at and tune.

Compiling a small program with the F# compiler is a good example. A significant amount of time is spent in JIT with R2R.

@elachlan
Copy link
Contributor

@AlexChuev might be able to provide a couple of example apps. Devexpress has a myriad of demo applications which would provide great examples of functional apps.

@jeffschwMSFT is there a plan to revisit r2r performance before .NET 5 release? or are you after specific test scenarios?

@mangod9
Copy link
Member

mangod9 commented Jul 15, 2020

assume these perf numbers are for certain UI specific scenarios?

@elachlan
Copy link
Contributor

@mangod9 Yes, AlexChuev's example is at https://github.com/AlexChuev/ReadyToRunPerformanceTest

@AlexChuev is it possible for you to update your repo to include the changes for .NET 5?

@mangod9
Copy link
Member

mangod9 commented Jul 16, 2020

It might be worthwhile to try crossgen2 composite functionality available in 5 to check if it improves this scenario. I tried to get a composite built for the repro, but looks like we have an issue we need to fix for that. Will create a separate issue for that.

@AlexChuev
Copy link

@elachlan sure, updated

@billwert
Copy link
Member

@jeffschwMSFT @mangod9 I'll take a quick look at this.

@mangod9
Copy link
Member

mangod9 commented Jul 16, 2020

cc: @dotnet/crossgen-contrib

@billwert
Copy link
Member

@jkotas @davidwrighton
Profiles show more time here:

Name Inc % Inc
coreclr!ClassLoader::LoadTypeHandleForTypeKey 73.4 83.991
+ coreclr!ClassLoader::LoadTypeDefThrowing 33.2 37.991
+ coreclr!SigPointer::GetTypeHandleThrowing 30.6 35
+ coreclr!ClassLoader::EnsureLoaded 11.4 13
+ coreclr!ClassLoader::LoadTypeHandleForTypeKey_Body -6.1 -7
+ coreclr!ClassLoader::LoadConstructedTypeThrowing 4.4 5

That's the bulk of the regression.

I validated that the number of assemblies loaded is the same (though obviously different versions). I assume the number of types is roughly the same also given it is the same scenario.

Is this enough of a breadcrumb? I can share the profiles to you if you'd like to take a look.

@jkotas
Copy link
Member

jkotas commented Jul 17, 2020

@billwert Thanks for collecting the profiles. Could you please share them?

@mangod9
Copy link
Member

mangod9 commented Jul 17, 2020

@MichalStrehovsky pointed out since WPF implies mc++ cg2 wouldnt support it currently. We will continue to investigate the 3.1->5.0 regression.

@davidwrighton
Copy link
Member

Last fall, I built up 3/4 of the logic necessary to see a view of the type system load events in a useful way in PerfView. I'll see if I can resurrect that work, and build up an understanding of what types we're actually working with here, and if there are significant differences from 3.1.

@jkotas
Copy link
Member

jkotas commented Jul 20, 2020

I see non-trivial amount of time spent in the new covariant return checks:

Name Inc % Inc
coreclr!ClassLoader::ValidateMethodsWithCovariantReturnTypes 6.6 40

@mangod9 mangod9 added this to the 6.0.0 milestone Aug 31, 2020
@hez2010
Copy link
Contributor

hez2010 commented Oct 29, 2020

I tested it with crossgen2 in .NET 5 RC2 on my machine but got exception in runtime:

Unhandled exception. System.TypeInitializationException: The type initializer for 'System.Windows.Media.FontFamily' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'MS.Internal.FontCache.DWriteFactory' threw an exception.
 ---> System.InvalidCastException: Specified cast is not valid.
   at MS.Internal.Text.TextInterface.Native.Util.ConvertHresultToException(Int32 hr)
   at MS.Internal.Text.TextInterface.Factory.Initialize(FactoryType factoryType)
   at MS.Internal.Text.TextInterface.Factory..ctor(FactoryType factoryType, IFontSourceCollectionFactory fontSourceCollectionFactory, IFontSourceFactory fontSourceFactory)
   at MS.Internal.FontCache.DWriteFactory..cctor()
   --- End of inner exception stack trace ---
   at MS.Internal.FontCache.DWriteFactory.get_SystemFontCollection()
   at System.Windows.Media.FontFamily..cctor()
   --- End of inner exception stack trace ---
   at MS.Internal.Text.DynamicPropertyReader.GetTypeface(DependencyObject element)
   at MS.Internal.Text.TextProperties.InitCommon(DependencyObject target)
   at MS.Internal.Text.TextProperties..ctor(FrameworkElement target, Boolean isTypographyDefaultValue)
   at System.Windows.Controls.TextBlock.GetLineProperties()
   at System.Windows.Controls.TextBlock.EnsureTextBlockCache()
   at System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Window.MeasureOverrideHelper(Size constraint)
   at System.Windows.Window.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Window.SetRootVisual()
   at System.Windows.Window.SetRootVisualAndUpdateSTC()
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.CreateSourceWindowDuringShow()
   at System.Windows.Window.SafeCreateWindowDuringShow()
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at ReadyToRunPerformanceTest.App.Main()

@springy76
Copy link

springy76 commented Nov 18, 2020

Is there a setting to let R2R build slow tier1 instead of just quick tier0? I don't want tiered compilation (TC) to neither use additional CPU nor additional memory because the server app is hosted some hundret times on the same server (strict tenant isolation by IIS app pools).

@mangod9
Copy link
Member

mangod9 commented Jul 26, 2021

crossgen has been removed in favor of crossgen2 in 6. We will continue to optimize R2R for .net 7.

@mangod9 mangod9 modified the milestones: 6.0.0, 7.0.0 Jul 26, 2021
@elachlan
Copy link
Contributor

elachlan commented Jun 21, 2022

I have copied @AlexChuev's repo and modified it for winforms.
https://github.com/elachlan/ReadyToRunPerformanceTest

Application Time to load assemblies
.NET6 (self-contained, no r2r) 1051 ms
.NET6 (self-contained, with r2r) 745 ms
.NET6 (self-contained, with r2r composite) 238 ms
.NET Framework (no native images) 883 ms
.NET Framework (with native images) 170 ms

I am looking into this as I am in the process of moving a .NET Framework winforms app to .NET 6. Start-up time and runtime performance are very important for customer experience in this scenario.

Edit: added composite result. first run for composite was the worst performance. But after relaunching it was very quick.

@mangod9 mangod9 modified the milestones: 7.0.0, Future Jul 27, 2022
@elachlan
Copy link
Contributor

elachlan commented Sep 4, 2022

I have updated the winforms version to .NET 7
https://github.com/elachlan/ReadyToRunPerformanceTest

Looks like there are slight regressions in .NET 7

@AlexChuev, could you confirm with your test?

Application Time to load assemblies
.NET6 (self-contained, no r2r, first run) 1118 ms
.NET6 (self-contained, no r2r) 463 ms
.NET6 (self-contained, with r2r, first run) 1179 ms
.NET6 (self-contained, with r2r) 282 ms
.NET6 (self-contained, with r2r composite, first run) 1257 ms
.NET6 (self-contained, with r2r composite) 228 ms
.NET7 (self-contained, no r2r, first run) 1385 ms
.NET7 (self-contained, no r2r) 478 ms
.NET7 (self-contained, with r2r, first run) 1416 ms
.NET7 (self-contained, with r2r) 282 ms
.NET7 (self-contained, with r2r composite, first run) 1297 ms
.NET7 (self-contained, with r2r composite) 291 ms
.NET Framework (no native images, first run) 393 ms
.NET Framework (no native images) 167 ms
.NET Framework (with native images) 160 ms

@elachlan
Copy link
Contributor

@mangod9 This displays a regression in r2r composite on .NET7.
Sorry for the long post/excessive data.

Perfview regression report:

Overweight report for symbols common between both files	
									
Base (old) Time: 435					
Test (new) Time: 483					
Delta: 48					
Delta %: 11
					
In this report, overweight is ratio of actual growth compared to 11.0%.						
Interest level attempts to identify smaller methods which changed a lot. These are likely the most interesting frames to sart investigating						
An overweight of greater than 100% indicates the symbol grew in cost more than average.						
High overweights are a likely source of regressions and represent good places to investigate.						
Only symbols that have at least 2% impact are shown.						
Name Base Test Delta Responsibility % Overweight % Interest Level
module system.windows.forms.primitives.il <> 6 16 10 20.83 1509.91 5
module coreclr <> 12 23 11 22.91 830.45 5
module readytorunperformancetest.r2r <> 29 48 19 39.57 593.55 5
module clrjit <> 33 52 19 39.57 521.61 5
module coreclr <> 72 108 36 74.97 452.97 5
module coreclr <> 27 40 13 27.07 436.2 5
module system.windows.forms.primitives.il <> 290 404 114 237.42 356.13 5
module system.windows.forms.primitives.il <> 280 372 92 191.6 297.67 5
module coreclr <> 136 167 31 64.56 206.5 5
module <> 83 66 -17 -35.41 -185.56 5
module user32 <> 26 15 -11 -22.91 -383.28 5
module apphelp <> 26 15 -11 -22.91 -383.28 5
module system.windows.forms.primitives.il <> 1 8 7 14.58 6341.62 4
module win32u <> 2 6 4 8.33 1811.89 4
module coreclr <> 3 8 5 10.41 1509.91 4
module kernelbase <> 2 5 3 6.25 1358.92 4
module ntdll <> 7 15 8 16.66 1035.37 4
module coreclr <> 8 15 7 14.58 792.7 4
BROKEN 6 11 5 10.41 754.96 4
module user32 <> 5 8 3 6.25 543.57 4
module ntdll <> 8 12 4 8.33 452.97 4
module uxtheme <> 15 22 7 14.58 422.77 4
module user32 <> 12 17 5 10.41 377.48 4
module user32 <> 20 26 6 12.5 271.78 4
module win32u <> 15 19 4 8.33 241.59 4
module ntdll <> 20 23 3 6.25 135.89 4
module kernelbase <> 20 23 3 6.25 135.89 4
module win32u <> 20 16 -4 -8.33 -181.19 4
module win32u <> 13 10 -3 -6.25 -209.06 4
module coreclr <> 12 9 -3 -6.25 -226.49 4
module win32u <> 26 19 -7 -14.58 -243.91 4
module apphelp <> 20 14 -6 -12.5 -271.78 4
module ntdll <> 9 6 -3 -6.25 -301.98 4
module fltmgr.sys <> 17 11 -6 -12.5 -319.75 4
module gdiplus <> 15 9 -6 -12.5 -362.38 4
module win32u <> 12 7 -5 -10.41 -377.48 4
module imm32 <> 10 5 -5 -10.41 -452.97 4
module msctf <> 7 3 -4 -8.33 -517.68 4
module coreclr <> 5 2 -3 -6.25 -543.57 4
module ntdll <> 11 4 -7 -14.58 -576.51 4
module comctl32 <> 12 4 -8 -16.66 -603.96 4
module user32 <> 9 3 -6 -12.5 -603.96 4
module ntfs.sys <> 6 2 -4 -8.33 -603.96 4
module ntdll <> 4 1 -3 -6.25 -679.46 4
module coreclr <> 4 1 -3 -6.25 -679.46 4
module user32 <> 4 1 -3 -6.25 -679.46 4
module coreclr <> 0 1 1 2.08 1509004 3
module coreclr <> 1 3 2 4.17 1811.89 3
module coreclr <> 1 2 1 2.08 905.95 3
module devexpress.utils.v22.1 <)>> 1 2 1 2.08 905.95 3
module clrjit <> 1 2 1 2.08 905.95 3
module coreclr <> 1 2 1 2.08 905.95 3
module readytorunperformancetest.r2r <> 1 2 1 2.08 905.95 3
module ntdll <> 3 5 2 4.17 603.96 3
module kernelbase <> 3 5 2 4.17 603.96 3
module ntdll <> 3 5 2 4.17 603.96 3
module readytorunperformancetest.r2r <> 2 3 1 2.08 452.97 3
module coreclr <> 4 6 2 4.17 452.97 3
module ntdll <> 6 8 2 4.2 304.52 3
module readytorunperformancetest.r2r <> 4 5 1 2.08 226.49 3
module coreclr <> 6 7 1 2.08 150.99 3
module icu <> 6 7 1 2.08 150.99 3
ROOT 435 483 48 100 100 3
module readytorunperformancetest.r2r <> 365 404 39 81.22 96.8 3
module user32 <> 338 372 34 70.81 91.13 3
module readytorunperformancetest.r2r <> 412 450 38 79.14 83.56 3
module coreclr <> 412 450 38 79.14 83.56 3
module win32kfull.sys <> 112 107 -5 -10.41 -40.44 3
module win32k.sys <> 112 107 -5 -10.41 -40.44 3
module ntdll <> 82 76 -6 -12.5 -66.29 3
module user32 <> 67 59 -8 -16.66 -108.17 3
module user32 <> 7 6 -1 -2.08 -129.42 3
module combase <> 6 5 -1 -2.08 -150.99 3
module gdi32full <> 11 9 -2 -4.17 -164.72 3
module coreclr <> 5 4 -1 -2.08 -181.19 3
module wdfilter.sys <> 4 3 -1 -2.08 -226.49 3
module apphelp <> 4 3 -1 -2.08 -226.49 3
module fileinfo.sys <> 7 5 -2 -4.17 -258.84 3
module uiautomationcore <> 6 4 -2 -4.17 -301.98 3
module devexpress.data.v22.1 <> 3 2 -1 -2.08 -301.98 3
module coreclr <> 2 1 -1 -2.08 -452.97 3
module readytorunperformancetest.r2r <> 2 1 -1 -2.08 -452.97 3
module win32u <> 2 1 -1 -2.08 -452.97 3
module coremessaging <> 2 1 -1 -2.08 -452.97 3
module readytorunperformancetest.r2r <> 2 1 -1 -2.08 -452.97 3
module amdkmdag.sys <> 2 1 -1 -2.08 -452.97 3
module system.drawing.common.il <> 2 1 -1 -2.08 -452.97 3
module win32u <> 2 1 -1 -2.08 -452.97 3
module clrjit <> 2 1 -1 -2.08 -452.97 3
module uxtheme <> 3 1 -2 -4.17 -603.96 3
module user32 <> 3 1 -2 -4.17 -603.96 3
module uxtheme <> 3 1 -2 -4.17 -603.96 3
module readytorunperformancetest.r2r <> 3 1 -2 -4.17 -603.96 3
module coreclr <> 3 1 -2 -4.17 -603.96 3
module kernel32 <> 428 464 36 75.01 76.24 2
module ntdll <> 428 464 36 75.01 76.24 2
module user32 <> 14 15 1 2.08 64.71 2
module win32kbase.sys <> 31 30 -1 -2.08 -29.22 2
module icu <> 11 10 -1 -2.08 -82.36 2
module win32u <> 11 10 -1 -2.08 -82.36 2

The Perfview Diff:

Name Exc % Exc  Inc %    Inc Fold
OS <<kernelbase!UnmapViewOfFile>>  31.2  15   31.2     15   0
module coreclr <<coreclr!RuntimeTypeHandle_GetTypeByName>>  20.8  10   22.9     11   0
OS <<ntoskrnl!?>>  18.7   9   16.7      8   0
module clrjit <<clrjit!CILJit::compileMethod>>  18.7   9   39.6     19   0
module coreclr <<coreclr!ThePreStub>>  18.7   9   64.6     31   0
module coreclr <<coreclr!FramedAllocateString>>  16.7   8   22.9     11   0
OS <<user32!GetMessageW>>  14.6   7   20.8     10   0
OS <<ntdll!LdrpDispatchUserCallTarget>>  12.5   6   12.5      6   0
OS <<ntdll!RtlpAllocateHeapInternal>>  10.4   5   10.4      5   0
OS <<kernelbase!LoadLibraryExW>>   8.3   4    6.2      3   0
OS <<kernelbase!VirtualAlloc>>   8.3   4    8.3      4   0
OS <<kernelbase!MapViewOfFile>>   8.3   4    8.3      4   0
module clrjit <<clrjit!`Compiler::fgInvokeInlineeCompiler'::`2'::<lambda_1>::operator()>>   8.3   4   12.5      6   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.Info.SkinXmlLoader::LoadSvgPalettesList(DevExpress.Utils.Svg.SvgPaletteDictionary)>>   8.3   4   50.0     24   0
module coreclr <<coreclr!DelayLoad_Helper>>   6.2   3   75.0     36   0
OS <<win32u!NtUserWaitMessage>>   6.2   3    6.2      3   0
OS <<user32!PeekMessageW>>   4.2   2    6.2      3   0
OS <<uiautomationcore!?>>   4.2   2   -4.2     -2   0
OS <<win32u!NtUserDestroyWindow>>   4.2   2    0.0      0   0
OS <<kernelbase!MapViewOfFileEx>>   4.2   2    4.2      2   0
LIB <<system.io.compression.native!?>>   4.2   2    4.2      2   0
OS <<kernelbase!GetProcAddressForCaller>>   4.2   2    4.2      2   0
module coreclr <<coreclr!DelayLoad_Helper_Obj>>   4.2   2   14.6      7   0
OS <<user32!CallWindowProcW>>   4.2   2   12.5      6   0
module ? <>   4.2 1.999  -35.4 -17.001 -0.001
LIB <<System.Private.CoreLib.il!SpanHelpers.IndexOf>>   2.1   1    2.1      1   0
OS <<icu!icu::`anonymous namespace'::MixedBlocks::makeHashCode>>   2.1   1    2.1      1   0
module coreclr <<coreclr!GlobalizationNative_CompareString>>   2.1   1    0.0      0   0
module coreclr <<coreclr!WKS::gc_heap::mark_object_simple1>>   2.1   1    2.1      1   0
OS <<ucrtbase!strlen>>   2.1   1    2.1      1   0
OS <<win32u!NtUserSetWindowPos>>   2.1   1    2.1      1   0
OS <<gdi32!?>>   2.1   1    2.1      1   0
OS <<icu!icu::CollationIterator::CEBuffer::append>>   2.1   1    2.1      1   0
module coreclr <<coreclr!MetaDataImport::Enum>>   2.1   1    2.1      1   0
module coreclr <<coreclr!Substitution::Substitution>>   2.1   1    2.1      1   0
module coreclr <<coreclr!CEEInfo::getFieldInfo>>   2.1   1    2.1      1   0
module coreclr <<coreclr!MethodDesc::CheckRestore>>   2.1   1    2.1      1   0
OS <<win32u!NtUserSetCursor>>   2.1   1    2.1      1   0
OS <<ucrtbase!common_vsprintf>>   2.1   1    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.Info.SkinXmlLoader::LoadSvgImageNames(DevExpress.Skins.SvgImageDictionary)>>   2.1   1    8.3      4   0
OS <<ntdll!RtlDeleteGrowableFunctionTable>>   2.1   1    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Text.RegularExpressions.RegexCompiler::.cctor()>>   2.1   1    2.1      1   0
module clrjit <<clrjit!Compiler::fgNewBBinRegion>>   2.1   1    2.1      1   0
module coreclr <<coreclr!AllocateStringFastMP_InlineGetThread>>   2.1   1    2.1      1   0
module coreclr <<coreclr!DelayLoad_Helper_ObjObj>>   2.1   1    4.2      2   0
module coreclr <<coreclr!CEEInfo::getMethodInfo>>   2.1   1    2.1      1   0
module clrjit <<clrjit!ValueNumStore::VNExceptionSet>>   2.1   1    2.1      1   0
module clrjit <<clrjit!GenTree::OperGet>>   2.1   1    2.1      1   0
module coreclr <<coreclr!MethodTable::MethodDataObject::GetDeclMethodDesc>>   2.1   1    2.1      1   0
OS <<kernelbase!CreateFileW>>   2.1   1    2.1      1   0
OS <<ntdll!RtlLookupFunctionEntry>>   2.1   1    4.2      2   0
OS <<ntdll!RtlFreeHeap>>   2.1   1    2.1      1   0
module coreclr <<coreclr!MDInternalRO::GetCustomAttributeByName>>   2.1   1    0.0      0   0
OS <<kernelbase!GetTimeZoneInformation>>   2.1   1    2.1      1   0
module coreclr <<coreclr!GetRuntimeFunctionCallback>>   2.1   1    2.1      1   0
module coreclr <<coreclr!Module::GetAssemblyIfLoaded>>   2.1   1    2.1      1   0
OS <<ntdll!RtlAllocateHeap>>   2.1   1    2.1      1   0
module coreclr <<coreclr!CEEInfo::resolveToken>>   2.1   1    4.2      2   0
module coreclr <<coreclr!COMDelegate::DelegateConstruct>>   2.1   1    2.1      1   0
OS <<ntdll!RtlGetFullPathName_Ustr>>   2.1   1    2.1      1   0
OS <<ntdll!_wcsnicmp>>   2.1   1    2.1      1   0
OS <<user32!RegisterClassW>>   2.1   1    2.1      1   0
OS <<kernelbase!GetFileAttributesExW>>   2.1   1    2.1      1   0
OS <<ntdll!LdrpGetProcedureAddress>>   2.1   1    2.1      1   0
module coreclr <<coreclr!JIT_ReversePInvokeEnterTrackTransitions>>   2.1   1    2.1      1   0
OS <<kernel32!CreateThreadStub>>   2.1   1    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.Size DevExpress.Skins.Info.SkinObjectConverter::IntStringToSize(System.String)>>   2.1   1    2.1      1   0
OS <<shcore!?>>   2.1   1    2.1      1   0
module coreclr <<coreclr!memcpy>>   2.1   1    2.1      1   0
OS <<dwrite!?>>   2.1   1    2.1      1   0
module coreclr <<coreclr!CustomAttributeParser::GetString>>   2.1   1    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Numerics.Matrix3x2 System.Drawing.Graphics::get_TransformElements()>>   2.1   1    0.0      0   0
module hostpolicy <<hostpolicy!corehost_main>>   0.0 0.017  937.2 450.017 0.017
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int,class System.String,class System.String,value class MB)>>   0.0   0  -16.7     -8   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.TimeZoneInfo::.cctor()>>   0.0   0    0.0      0   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class MSG&)>>   0.0   0  191.6     92   0
OS <<user32!DispatchClientMessage>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraGrid.Views.Base.ColumnView::.cctor()>>   0.0   0    2.1      1   0
module coreclr <<coreclr!RuntimeMethodHandle::GetUtf8Name>>   0.0   0    2.1      1   0
OS <<icu!ucol_openRules>>   0.0   0   -2.1     -1   0
OS <<icu!unum_open>>   0.0   0    0.0      0   0
module coreclr <<coreclr!CEEJitInfo::allocMem>>   0.0   0    6.2      3   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int,value class HDC,value class RECT&)>>   0.0   0   -4.2     -2   0
module coreclr <<coreclr!WaitHandleNative::CorWaitOneNative>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Collections.Concurrent.ConcurrentDictionary`2[System.Diagnostics.Metrics.ObjectSequence1, System.__Canon] System.Diagnostics.Metrics.FixedSizeLabelNameDictionary`3+<>c[System.Diagnostics.Metrics.StringSequence1, System.Diagnostics.Metrics.ObjectSequence1, System.__Canon]::b__1_0(System.Diagnostics.Metrics.StringSequence1)>>   0.0   0   -4.2     -2   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.Control::DefWndProc(System.Windows.Forms.Message&)>>   0.0   0   -4.2     -2   0
ROOT   0.0   0  100.0 48.016   0
module coreclr <<coreclr!DynamicHelperWorker>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int,pMT: 00007FF99A2E48C8&,int&)>>   0.0   0   -8.3     -4   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_ReversePInvoke(int64,unsigned int32,int64,int64)>>   0.0   0  237.4    114   0
module coreclr <<coreclr!CEEInfo::runWithErrorTrap>>   0.0   0    4.2      2   0
module coreclr <<coreclr!CEEInfo::getCallInfo>>   0.0   0    2.1      1   0
module devexpress.utils.v22.1 <<devexpress.utils.v22.1!BehaviorManager.Register>>   0.0   0    2.1      1   0
OS <<ucrtbase!strcmp>>   0.0   0    0.0      0   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int,value class WINDOWPLACEMENT&)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraGrid.GridControl::.cctor()>>   0.0   0   39.6     19   0
module coreclr <<coreclr!JitHost::allocateSlab>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.Font System.Drawing.Font::FromLogFontInternal(Interop+User32+LOGFONT&, System.IntPtr)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int32,int32,int32,int32,int,int&)>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!CEEInfo::getArgClass>>   0.0   0    0.0      0   0
module hostfxr <<hostfxr!hostfxr_main_startupinfo>>   0.0   0  937.2 450.017   0
module coreclr <<coreclr!coreclr_execute_assembly>>   0.0   0   79.1 37.999   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit::RegisterGridLookUpEdit()>>   0.0   0    2.1      1   0
module coreclr <<coreclr!GlobalizationNative_GetLocaleInfoInt>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Utils.DPI.DpiUtilities::.cctor()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Utils.AppearanceObject::.cctor()>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraGrid.Localization.GridLocalizer::.cctor()>>   0.0   0    2.1      1   0
module coreclr <<coreclr!GlobalizationNative_IanaIdToWindowsId>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.ColorTable::.cctor()>>   0.0   0    2.1      1   0
module devexpress.utils.v22.1 <<devexpress.utils.v22.1!SkinXmlLoader.LoadImage>>   0.0   0   75.0     36   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Utils.Svg.SvgPaletteKey::.cctor()>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Xpo.Logger.LogManager+d__37`1[System.Int32]::SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)>>   0.0   0    2.1      1   0
LIB <<System.Private.CoreLib.il!SpanHelpers.Contains>>   0.0   0    0.0      0   0
module coreclr <<coreclr!GlobalizationNative_GetSortKey>>   0.0   0    2.1      1   0
OS <<icu!ucol_getSortKey>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraEditors.WindowsFormsSettings::.cctor()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.SkinImage::set_ImageName(System.String)>>   0.0   0    8.3      4   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.SkinImage::set_ImageCount(System.Int32)>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Boolean System.Xml.XmlTextReaderImpl::ParseElementContent()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Utils.DPI.UnsafeDpiNativeMethods::.cctor()>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Reflection.AssemblyName::ParseAsAssemblySpec(System.Char*, System.Void*)>>   0.0   0    4.2      2   0
module coreclr <<coreclr!COMCustomAttribute::CreateCaObject>>   0.0   0    2.1      1   0
module clrjit <<clrjit!Compiler::optAssertionGen>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Data.Utils.SafeProcess::RegisterConfirmationService(DevExpress.Data.Utils.SafeProcess+IConfirmationService)>>   0.0   0    2.1      1   0
ReadyToRunPerformanceTest   0.0   0  100.0 48.016   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraEditors.ComponentBase::.cctor()>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Utils.Behaviors.BehaviorManager::.cctor()>>   0.0   0    2.1      1   0
module coreclr <<coreclr!JIT_GetSharedNonGCStaticBase_Helper>>   0.0   0    2.1      1   0
Thread   0.0   0  100.0 48.016   0
module readytorunperformancetest <<readytorunperformancetest!__scrt_common_main_seh>>   0.0   0  937.2 450.017   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!ReadyToRunPerformanceTest.Program::Main()>>   0.0   0   79.1     38   0
OS <<icu!ucal_getWindowsTimeZoneID>>   0.0   0    0.0      0   0
module devexpress.utils.v22.1 <<devexpress.utils.v22.1!DevExpress.LookAndFeel.UserLookAndFeel+EventRecord`1[System.__Canon]..ctor(class System.EventHandler)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Text.RegularExpressions.RegexCharClass::.cctor()>>   0.0   0    2.1      1   0
module coreclr <<coreclr!TheUMEntryPrestub>>   0.0   0    6.2      3   0
OS <<user32!GetWindowTextW>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.IntPtr System.Windows.Forms.Control::get_Handle()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.NativeWindow::DefWndProc(System.Windows.Forms.Message&)>>   0.0   0    2.1      1   0
OS <<ntdll!EtwEventWriteTransfer>>   0.0   0    0.0      0   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int,int,int,class IRawElementProviderSimple)>>   0.0   0    6.2      3   0
OS <<combase!?>>   0.0   0   -2.1     -1   0
module devexpress.data.v22.1 <<devexpress.data.v22.1!DevExpress.Utils.Localization.XtraResXLocalizer`1[DevExpress.XtraGrid.Localization.GridStringId].GetLocalizedString(!0)>>   0.0   0    0.0      0   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.String System.Resources.ResourceManager::GetString(System.String, System.Globalization.CultureInfo)>>   0.0   0    8.3      4   0
module coreclr <<coreclr!AssemblyNative_InternalLoad>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Reflection.Assembly System.Runtime.Loader.AssemblyLoadContext::ResolveSatelliteAssembly(System.IntPtr, System.Reflection.AssemblyName)>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Collections.Generic.ArrayBuilder`1[System.Collections.Generic.Marker]::EnsureCapacity(System.Int32)>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.String System.Enum::ToString()>>   0.0   0   -4.2     -2   0
module coreclr <<coreclr!Enum_GetValuesAndNames>>   0.0   0    2.1      1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class WS_EX,wchar*,class System.String,value class WS,int32,int32,int32,int32,int,int,int,class System.Object)>>   0.0   0   20.8     10   0
module coreclr <<coreclr!NDirectImportThunk>>   0.0   0   10.4      5   0
module devexpress.data.v22.1 <<devexpress.data.v22.1!DevExpress.Utils.Localization.XtraResXLocalizer`1[DevExpress.XtraEditors.Controls.StringId].GetLocalizedString(!0)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Collections.IEnumerator System.Linq.Enumerable+d__122`1[DevExpress.XtraEditors.ColumnAutoFilterCondition]::System.Collections.IEnumerable.GetEnumerator()>>   0.0   0    2.1      1   0
LIB <<system.drawing.common.il!Graphics.GetContextInfo>>   0.0   0    0.0      0   0
LIB <<system.private.xml.il!XmlTextReaderImpl.ParseXmlDeclaration>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Xml.XmlTextReaderImpl::SwitchEncoding(System.Text.Encoding)>>   0.0   0    2.1      1   0
module coreclr <<coreclr!JIT_PInvokeEnd>>   0.0   0    0.0      0   0
module coreclr <<coreclr!JIT_NewMDArr>>   0.0   0    2.1      1   0
module coreclr <<coreclr!ObjectNative::AllocateUninitializedClone>>   0.0   0    2.1      1   0
OS <<uxtheme!DrawThemeParentBackgroundEx>>   0.0   0   -4.2     -2   0
OS <<user32!FillRect>>   0.0   0    0.0      0   0
OS <<apphelp!SrHook_ShowWindow>>   0.0   0  -12.5     -6   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class System.Runtime.InteropServices.HandleRef,class System.String,value class WNDCLASS&)>>   0.0   0    0.0      0   0
OS <<ntdll!EtwEventRegister>>   0.0   0    0.0      0   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class HDC,wchar*,int32,value class RECT&,value class DT,value class DRAWTEXTPARAMS&)>>   0.0   0   -4.2     -2   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Text.RegularExpressions.Regex::.cctor()>>   0.0   0    2.1      1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int,class System.String,class System.String,value class MB)>>   0.0   0  -37.5    -18   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Object DevExpress.Utils.ChunkedArray`1+d__16[System.__Canon]::System.Collections.IEnumerator.get_Current()>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!DelayLoad_MethodCall>>   0.0   0   27.1     13   0
LIB <<system.text.regularexpressions.il!dynamicClass.Regex1_Scan(pMT: 00007FF99A1DCDA8,pMT: 00007FF999A909A8)>>   0.0   0    4.2      2   0
module clrjit <<clrjit!`Compiler::impCheckCanInline'::`2'::<lambda_1>::operator()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.Info.SkinXmlLoader::LoadMargins(DevExpress.Skins.SkinPaddingEdges, System.Int32)>>   0.0   0    2.1      1   0
OS <<ntdll!RtlLeaveCriticalSection>>   0.0   0    0.0      0   0
LIB <<system.drawing.common.il!System.Drawing.Graphics.Save()>>   0.0   0   -2.1     -1   0
OS <<user32!DrawTextExW>>   0.0   0    0.0      0   0
module coreclr <<coreclr!ZapSig::DecodeMethod>>   0.0   0    2.1      1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class MSG&,int,value class WM,value class WM,value class PM)>>   0.0   0   14.6      7   0
module coreclr <<coreclr!ClassLoader::LoadTypeDefThrowing>>   0.0   0    2.1  0.999   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.DpiHelper::Initialize()>>   0.0   0    2.1      1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.SafeNativeMethods+Gdip::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Text.RegularExpressions.Symbolic.SymbolicRegexRunnerFactory+Runner`1[System.UInt64]::Scan(System.ReadOnlySpan`1[System.Char])>>   0.0   0    2.1      1   0
module coreclr <<coreclr!RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter>>   0.0   0    2.1      1   0
module clrjit <<clrjit!DoPhase>>   0.0   0    2.1      1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int,int,int,class IRawElementProviderSimple)>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!SString::Set>>   0.0   0    2.1      1   0
module coreclr <<coreclr!DomainAssembly::EnsureLoadLevel>>   0.0   0    2.1      1   0
module coreclr <<coreclr!DispatchCallSimple>>   0.0   0    2.1      1   0
OS <<user32!SystemParametersInfoW>>   0.0   0    0.0      0   0
module readytorunperformancetest <<readytorunperformancetest!?>>   0.0   0 -858.0 -412.001   0
module hostfxr <<hostfxr!?>>   0.0   0 -858.0 -412.001   0
module hostpolicy <<hostpolicy!?>>   0.0   0 -858.0 -412.001   0
module coreclr <<coreclr!??CEEJitInfo::allocMem>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Object DevExpress.Data.Mask.Internal.MaskSettings`1+<>c__DisplayClass57_0`1[DevExpress.XtraEditors.Mask.MaskType, DevExpress.Data.Mask.TimeSpanMaskInputMode]::b__0()>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!RuntimeTypeHandle::CreateInstanceForAnotherGenericParameter>>   0.0   0   -4.2     -2   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.LookAndFeel.UserLookAndFeel+EventRecordCache::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.SkinElementPainter::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Data.DataControllerBase::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.DrawingCom::.cctor()>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!ClassLoader::LoadTypeHandleForTypeKey>>   0.0   0   -2.1     -1   0
BROKEN   0.0   0   10.4      5   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Collections.Generic.GenericArraySortHelper`1[System.__Canon]::.ctor()>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class WS_EX,wchar*,class System.String,value class WS,int32,int32,int32,int32,int,int,int,class System.Object)>>   0.0   0  -25.0    -12   0
module coreclr <<coreclr!MetaSig::CompareMethodSigs>>   0.0   0   -2.1     -1   0
OS <<win32u!NtUserMessageCall>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(pMT: 00007FF99A2D0F08,pMT: 00007FF99A2D0F08,int32,int32)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.Form::UpdateWindowState()>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!COMDelegate::GetMulticastInvoke>>   0.0   0    2.1      1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class HDC,value class RECT&,value class HBRUSH)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(class System.String,int,unsigned int32)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(value class MSG&,int,unsigned int32,unsigned int32)>>   0.0   0   20.8     10   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.IntPtr System.Windows.Forms.NativeWindow+WindowClass::Callback(System.IntPtr, Interop+User32+WM, System.IntPtr, System.IntPtr)>>   0.0   0   -8.3     -4   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(class System.String,pMT: 00007FF99A2D0F08,int&)>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!AssemblyNative::InternalLoad>>   0.0   0   -4.2     -2   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Int32 MS.Internal.LegacyPriorityQueue`1[MS.Internal.FontFace.PhysicalFontFamily+MatchingFace]::HeapRightFromLeft(System.Int32)>>   0.0   0   -2.1     -1   0
OS <<win32u!NtUserCallHwndLock>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!RuntimeMethodHandle::InvokeMethod>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Drawing.Region System.Drawing.Graphics::GetRegionIfNotInfinite()>>   0.0   0   -2.1     -1   0
LIB <<System.Private.CoreLib.il!System.Collections.Generic.GenericArraySortHelper`1[System.UInt64].BinarySearch(!0[],int32,int32,!0,class System.Collections.Generic.IComparer`1)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(class IRawElementProviderSimple,value class UIA,class System.Object,class System.Object)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(pMT: 00007FF99A2D0F08,pMT: 00007FF99A2D0F08)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Delegate System.Delegate::CreateDelegate(System.Type, System.Object, System.Reflection.MethodInfo, System.Boolean)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Object System.RuntimeTypeHandle::CreateInstanceForAnotherGenericParameter(System.RuntimeType, System.RuntimeType)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Reflection.RuntimeAssembly System.Runtime.Loader.AssemblyLoadContext::OnAssemblyResolve(System.Reflection.RuntimeAssembly, System.String)>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int)>>   0.0   0  -10.4     -5   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.__Canon[] System.Collections.Generic.ICollectionDebugView`1[System.__Canon]::get_Items()>>   0.0   0   -4.2     -2   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.DpiHelper::.cctor()>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.Control::.cctor()>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!ComCallPreStub>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(class IRawElementProviderSimple)>>   0.0   0   -8.3     -4   0
module coreclr <<coreclr!McGenEventWrite_EventWriteTransfer>>   0.0   0   -4.2     -2   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_ReversePInvoke(int64,unsigned int32,int64,int64)>>   0.0   0 -158.3    -76   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int)>>   0.0   0   -8.3     -4   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Boolean System.Xml.XmlTextReader::Read()>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class HDC,wchar*,int32,value class RECT&,value class DT,value class DRAWTEXTPARAMS&)>>   0.0   0   -8.3     -4   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int,value class HDC,value class RECT&)>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(class System.String,int,unsigned int32)>>   0.0   0   -4.2     -2   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class MSG&)>>   0.0   0 -120.8    -58   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Threading.ExecutionContext::RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)>>   0.0   0    8.3      4   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class MSG&,int,value class WM,value class WM,value class PM)>>   0.0   0   -8.3     -4   0
OS <<ntdll!KiUserCallbackDispatcherContinue>>   0.0   0   14.6      7   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class System.Runtime.InteropServices.HandleRef,int32,value class System.Guid&,class System.Object&)>>   0.0   0   -2.1     -1   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(value class MSG&,int,unsigned int32,unsigned int32)>>   0.0   0   -8.3     -4   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.Control::SetBounds(System.Int32, System.Int32, System.Int32, System.Int32, System.Windows.Forms.BoundsSpecified)>>   0.0   0   -2.1     -1   0
LIB <<system.windows.forms.primitives.il!dynamicClass.IL_STUB_PInvoke(int,pMT: 00007FF99A2E48C8&,int&)>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Windows.Forms.Control::WndProc(System.Windows.Forms.Message&)>>   0.0   0   -4.2     -2   0
OS <<win32u!NtUserGetSystemMenu>>   0.0   0   -2.1     -1   0
module coreclr <<coreclr!ThreadNative::KickOffThread>>   0.0   0   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Threading.Thread::StartCallback()>>   0.0   0  -10.4     -5   0
module ManagedModule <<ManagedModule!dynamicClass.IL_STUB_PInvoke(int32,class System.String,class System.String,int32,int32,int32,int32,int32,int,int,int,int)>>   0.0   0   -2.1     -1   0
OS <<user32!GetClassInfoW>>  -2.1  -1    0.0      0   0
OS <<windowscodecs!?>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_WriteBarrier>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!MethodTable::MethodDataInterface::GetDeclMethodDesc>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_MonExit_Portable>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!CMiniMd::vSearchTableNotGreater>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_NewArr1>>  -2.1  -1   -4.2     -2   0
OS <<win32u!NtUserGetDC>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Compiler::fgSetTreeSeqHelper>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Compiler::fgInterBlockLocalVarLiveness>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!NtAlpcSendWaitReceivePort>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!MDInternalRO::GetSigOfMethodDef>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!MDInternalRO::EnumInit>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_NewArr1OBJ_MP_InlineGetThread>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!StubHelpers::InterfaceMarshaler__ConvertToNative>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_GetSharedGCThreadStaticBase>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_ByRefWriteBarrier>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Compiler::lvaStructPromotionInfo::lvaStructPromotionInfo>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_CheckedWriteBarrier>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!ComMethodTable::GetIID>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!COMInterlocked::CompareExchange64>>  -2.1  -1   -2.1     -1   0
module comctl32 <<comctl32!?>>  -2.1  -1  -16.7     -8   0
OS <<ntdll!LdrpLoadDependentModule>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Rationalizer::RewriteNode>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!MDInternalRO::GetTypeDefProps>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!SigParser::SkipExactlyOne>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!COMDelegate::BindToMethodInfo>>  -2.1  -1   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.String System.Xml.XmlTextReader::GetAttribute(System.String)>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!ReflectionEnum::GetEnumValuesAndNames>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_TrialAllocSFastMP_InlineGetThread>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!LdrpAllocateModuleEntry>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!CompilerPhase::DoPhase>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!SignatureNative::GetSignature>>  -2.1  -1    0.0      0   0
module coreclr <<coreclr!ModuleHandle::ResolveType>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!strrchr>>  -2.1  -1   -2.1     -1   0
OS <<textinputframework!?>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!MethodTable::GetMethodData>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!RtlEnterCriticalSection>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!<lambda_c7e1be22c8a3313b95abda4db0169a1c>::operator()>>  -2.1  -1   -8.3     -4   0
module coreclr <<coreclr!CompareTypeTokens>>  -2.1  -1   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Runtime.Loader.AssemblyLoadContext::StartAssemblyLoad(System.Guid&, System.Guid&)>>  -2.1  -1   -4.2     -2   0
OS <<ntdll!NtAllocateVirtualMemory>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!RtlActivateActivationContextUnsafeFast>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Compiler::lvaGrabTemp>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!GenTree::VisitOperands >>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!NtClose>>  -2.1  -1   -2.1     -1   0
OS <<icu!icu::`anonymous namespace'::MixedBlocks::extend>>  -2.1  -1   -2.1     -1   0
OS <<icu!icu::`anonymous namespace'::MutableCodePointTrie::get>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!RtlpFreeHeap>>  -2.1  -1   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Boolean System.Xml.XmlTextReaderImpl::ParseText(System.Int32&, System.Int32&, System.Int32&)>>  -2.1  -1   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.Int32 DevExpress.Skins.SkinPaddingEdges::get_Bottom()>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!Precode::AllocateTemporaryEntryPoints>>  -2.1  -1   -2.1     -1   0
OS <<apphelp!SE_GetProcAddressForCaller>>  -2.1  -1   -2.1     -1   0
OS <<ntdll!RtlHashUnicodeString>>  -2.1  -1   -2.1     -1   0
OS <<amdkmdag.sys!?>>  -2.1  -1   -2.1     -1   0
OS <<user32!DispatchMessageWorker>>  -2.1  -1   70.8     34   0
OS <<uxtheme!EndBufferedAnimation>>  -2.1  -1   -2.1     -1   0
OS <<uxtheme!DrawThemeText>>  -2.1  -1   -2.1     -1   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.String System.Resources.ResourceManager::GetString(System.String)>>  -2.1  -1   -8.3     -4   0
module coreclr <<coreclr!SigPointer::GetTypeHandleThrowing>>  -2.1  -1   -2.1     -1   0
module clrjit <<clrjit!Compiler::fgInsertInlineeBlocks>>  -2.1  -1   -2.1     -1   0
module coreclr <<coreclr!JIT_GetGenericsGCStaticBase>>  -2.1  -1   -6.2     -3   0
module coreclr <<coreclr!JIT_New>>  -2.1  -1   -6.2     -3   0
OS <<ntdll!RtlGrowFunctionTable>>  -2.1  -1   -2.1     -1   0
module gdiplus <<gdiplus!?>>  -4.2  -2  -12.5     -6   0
OS <<win32u!NtUserSetFocus>>  -4.2  -2   -6.2     -3   0
OS <<user32!CreateWindowExW>>  -4.2  -2    0.0      0   0
OS <<uxtheme!IsAppThemed>>  -4.2  -2   -4.2     -2   0
OS <<uxtheme!BufferedPaintRenderAnimation>>  -4.2  -2   -4.2     -2   0
OS <<user32!SendMessageW>>  -4.2  -2   -8.3     -4   0
OS <<user32!DefWindowProcW>>  -4.2  -2   -6.2     -3   0
OS <<ntdll!RtlUserThreadStart>>  -4.2  -2   75.0 36.016   0
OS <<ntdll!LdrResolveDelayLoadedAPI>>  -4.2  -2   -2.1     -1   0
OS <<apphelp!SrHook_MessageBoxW>>  -6.2  -3  -22.9    -11   0
module coreclr <<coreclr!JIT_GenericHandleClassWithSlotAndModule>>  -6.2  -3   -6.2     -3   0
OS <<ntdll!RtlVirtualUnwind>> -14.6  -7  -14.6     -7   0
module coreclr <<coreclr!RuntimeTypeHandle::GetTypeByName>> -18.7  -9  -22.9    -11   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!System.IntPtr System.Windows.Forms.NativeWindow::Callback(System.IntPtr, Interop+User32+WM, System.IntPtr, System.IntPtr)>> -35.4 -17   81.2     39   0

@EgorBo
Copy link
Member

EgorBo commented Sep 17, 2022

@elachlan out of curiosity, can you try with DOTNET_EnableWriteXorExecute=0 ? (it was responsible for start up regressions in some of our workloads). Btw, your project doesn't restore for me, can't find the devexpress nuget packages

@elachlan
Copy link
Contributor

@AlexChuev is it possible to get the JIT team a devexpress nuget feed for this test?

@EgorBo, thanks for getting back to me. I will test this and get back to you here.

@elachlan
Copy link
Contributor

@EgorBo setting that environment variable did bring the performance back in line with composite R2R. When you scale it to the whole app.

Regression Report:

Base (old) Time: 435
Test (new) Time: 428.1
Delta: -6.9
Delta %: -1.6

I narrowed the time range in Perfview from when the button is clicked. For a true test of the performance whilst running. This is with the env variable.

Regression Report:

Base (old) Time: 286.1
Test (new) Time: 314
Delta: 27.9
Delta %: 9.7

Here is the Exc% values greater than 5%

Name Exc % Exc Inc %  Inc Fold
module clrjit <<clrjit!CILJit::compileMethod>> 68.2 19  89.7   25   0
module coreclr <<coreclr!ThePreStub>> 60.5 16.866 143.1 39.866   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.Info.SkinXmlLoader::LoadSvgPalettesList(DevExpress.Utils.Svg.SvgPaletteDictionary)>> 32.3  9 107.7   30   0
module coreclr <<coreclr!RuntimeTypeHandle_GetTypeByName>> 32.3  9  35.9   10   0
module coreclr <<coreclr!JIT_New>> 28.7  8  32.3    9   0
OS <<user32!MessageBoxW>> 28.7  8  50.2   14   0
OS <<kernelbase!VirtualAlloc>> 21.5  6  21.5    6   0
OS <<ntdll!LdrpDispatchUserCallTarget>> 17.9  5  17.9    5   0
module coreclr <<coreclr!FramedAllocateString>> 14.4  4   3.6    1   0
OS <<user32!SystemParametersInfoW>> 10.8  3  10.8    3   0
OS <<ntdll!RtlLookupFunctionEntry>> 10.8  3  10.8    3   0
OS <<kernelbase!CreateFileW>> 10.8  3  10.8    3   0
module coreclr <<coreclr!ResolveWorkerAsmStub>>  7.2  2  10.8    3   0
module readytorunperformancetest.r2r <<readytorunperformancetest.r2r!DevExpress.Skins.Info.SkinXmlLoader::LoadSvgImageNames(DevExpress.Skins.SvgImageDictionary)>>  7.2  2  17.9    5   0
module coreclr <<coreclr!JIT_WriteBarrier>>  7.2  2   7.2    2   0

CC: @AlexChuev

@mangod9
Copy link
Member

mangod9 commented Sep 27, 2022

just to confirm is the regression with WriteXorExecute enabled only with composite? @tyrlek @janvorli

@elachlan
Copy link
Contributor

just to confirm is the regression with WriteXorExecute enabled only with composite? @tyrlek @janvorli

The measurement directly above was with DOTNET_EnableWriteXorExecute=0 and composite. The startup is faster, but the button click where the work happens is slower.

The other measurement in the post I tagged you, that did not have the env variable DOTNET_EnableWriteXorExecute set.

@ekalchev
Copy link

ekalchev commented May 1, 2023

I am not sure if my issue is related to this one but I'll leave it here just in case.

We have WPF app with .net framework 4.8. I measure JIT time during startup with Jetbrains dotTrace profiler. I noticed that using ngen our app have 3x less JIT during startup compared to R2R images generated from ngenR2R.exe. Here are the measurements

  1. Without native image generator - 6500ms in JIT during startup
  2. With ngen.exe 600ms in JIT during startup
  3. With ngenR2R.exe 2100ms in JIT during startup

ngenR2R.exe tool comes from here https://www.nuget.org/packages/Microsoft.DotNet.Framework.NativeImageCompiler

@dennis-garavsky
Copy link

dennis-garavsky commented Aug 18, 2023

@mangod9 @EgorBo CC @elachlan

Problem
We at DevExpress (a .NET component vendor) also experienced a related performance issue with DesignToolsServer.exe (a part of the Microsoft WinForms out-of-process designer infrastructure for .NET Core apps).
The issue is that the .NET out-of-process designer may freeze Visual Studio for 5-10 seconds, when a .NET 6+ project with third-party UI component libraries (like DevExpress and others) is being rebuilt or debugged. DesignToolsServer.exe often loads and unloads libraries with components for some reason, which causes this slowness. We are aware of known ngen/R2R performance issues in .NET 6+, and wanted to ask you to verify whether it is really related (we suspect JIT, but are not 100% sure). I also admit that DesignToolsServer.exe may potentially be changed to avoid/bypass this behavior - it may be better to show this to the Microsoft WinForms Team for review as well.

Impact Estimate
Real-world customer projects typically contain dozens of vendor component packages. Almost all third-party component vendors have hundreds of components in their packages (grids, editors, charts, and other UI components). Hundreds of vendor/third-party components usually reside in dozens of assemblies, and these assemblies can be hundreds of megabytes in size. This behavior may potentially affect all major/popular WinForms component vendors, including but not limited to DevExpress, Telerik, Syncfusion, Infragistics, and many others. We already received multiple reports on this from paying customers.

Further Information
I hope this clarifies the impact this Visual Studio/JIT behavior may have on Microsoft users and third-party component vendors/partners. If you need to get a private NuGet feed with DevExpress components for your internal testing, please email me at dennis@devexpress.com. I will also be happy to answer any additional questions/give more repro info for your .NET Core Runtime Team to improve this situation for the entire .NET developer community.  

Thanks,
Dennis Garavsky
Product Manager
dennis@devexpress.com

@elachlan
Copy link
Contributor

@dennis-garavsky can you raise this in the winforms repo for better visibility?

@elachlan
Copy link
Contributor

CC: @KlausLoeffelmann @merriemcgaw

You might be interested in the designer perf issues mentioned above.

@merriemcgaw
Copy link
Member

Thanks @elachlan! We've addressed a bunch of serialization performance issues with VS in the most recent 17.8 Preview builds. @dennis-garavsky can your team see if these improvements are helping the situation?

@mikhailovalex
Copy link

Hello @merriemcgaw, @elachlan and others
We tested v17.8 preview 1, but we didn't notice any significant improvements in performance. Please note that we don't have serialization issues such as this one: https://github.com/microsoft/winforms-designer/issues/5279.

Our main point is that DesignToolsServer.exe is reloaded each time after we make changes to the code and rebuild the project. In an empty winforms project, it takes 3-4 seconds. In a project with DevExpress assemblies, it takes 8-10 seconds. At the same time, this most likely occurs because our package has a very large number of dlls that need to be loaded in a process. That is why we expect to speed up loading time with Ready2Run technology.

@merriemcgaw
Copy link
Member

The DesignToolsServer.exe is expected to reload every time the project opens and again when there are certain types of changes to the project. @Shyam-Gupta is our domain expert there. We are actively looking for ways to make improvements in loading of the process. We have a lot of people off for summer holidays. When everyone is back we will explore bumping up the priority on these improvements (in the next couple weeks).

@danmoseley
Copy link
Member

Should @ekalchev open an issue in winforms repo?

@Shyam-Gupta
Copy link
Member

As per the current architecture, DesignToolsServer.exe restarts every time user builds the project and binaries get updated. This enables the process to load updated binaries and support modified user types if any. After launching the process, all user binaries are loaded which is required for MEF composition and then types are extracted from the binaries to support object instantiation using reflection.
For a project having large number of references, it might cause delays. This is a known issue and it is in our backlog.
We plan to add ability to unload AssemblyLoadContext to unload user binaries and reload them in same process instance instead of launching a new process instance every time. But we need to explore its feasibility and see if other improvements are also possible.
I don't think this issue is related to ReadyToRun efficieny problem being discussed here. So probably @ekalchev can open an issue in WinForms repo for tracking. Thanks.

@ekalchev
Copy link

@danmoseley, @Shyam-Gupta I don't have winforms issue. You probably wanted to tag someone else?

@lindexi
Copy link
Member

lindexi commented Mar 1, 2024

Can I ask any update here? I'm deeply grateful for the numerous performance optimizations made by the dotnet team in .NET 8. However, I still encounter issues with startup performance. Over the past six months, I've assisted many colleagues in migrating their projects from .NET Framework to .NET Core, with some even upgrading directly to .NET 8. Unfortunately, the common feedback I've received is that the startup performance after updating to .NET Core is slower than the original .NET Framework. My concern is that despite years of optimization, from the perspective of desktop application developers, the startup performance has not yet returned to the level of .NET Framework. This could potentially dampen the enthusiasm of desktop application developers.

I believe there are still two main factors affecting the startup performance of .NET Core applications. The first is that although ReadyToRun can speed up the process, it leads to larger DLL sizes, which in turn results in longer file IO times. The second is that .NET Core requires loading a large number of DLL files during startup, and it's difficult to share them in the same way as .NET Framework's GAC, resulting in significant IO pressure, especially in HDD disk. What's worse is that as more and more users report that Windows Updater damages the .NET Core environment, an increasing number of desktop developers are forced to choose standalone (self-contained) publishing instead of framework-dependent methods. This further results in application programs not being able to enjoy the acceleration brought about by shared DLLs during cold startup.

I understand that this is a challenging task, but I look forward to seeing better startup performance optimizations in .NET in the future, to make desktop developers happy.

@rickbrew
Copy link
Contributor

rickbrew commented Mar 1, 2024

@lindexi Are those projects that are using WPF? My understanding is that an important portion of WPF cannot (currently) be R2R'd because they are mixed-mode assemblies (managed and native code), because they are written in C++/CLI. In the past this was due to PresentationCore (IIRC), but nowadays I think that has all been extracted to DirectWriteForwarder. That's currently the only one I'm seeing with [assembly: AssemblyMetadata("Language", "C++")].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests