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

[armel] Crossgen2 skip many methods during Version Bubble compilation #44948

Open
alpencolt opened this issue Nov 19, 2020 · 8 comments
Open
Labels
Milestone

Comments

@alpencolt
Copy link

alpencolt commented Nov 19, 2020

Description

As we discussed by email, crossgen2 doesn't compile many methods which should compile in Large Version Bubble mode with option compilebubblegenerics .
From @jkotas

  • Methods like GetIndexOfFirstNonAsciiByte_Default that use Vector<T> should be crossgened after Implement concept of unstable ABI into crossgen2 #40820 . If you are running with this change, it sounds like a bug or configuration problem.
  • Methods like SpanHelpers.IndexOf are marked with AggressiveOptimization that prevents them from being precompiled. I think this is just a bug. The reason for them being marked this way should no longer apply after Implement concept of unstable ABI into crossgen2 #40820.
  • Generic instantiations like System.Collections.Concurrent.ConcurrentDictionary`2[System.Int32,System.__Canon] contained within same version bubble are either a bug in crossgen2 or should be taken care of by having PGO data.
  • IL_STUB_PInvoke - these should get fixed by Source generation of ILStub for DllImport #43060.
  • IL_STUB_ReversePInvoke - this should be avoidable by changing the code to take advantage of UnmanagedCallersOnlyAttribute and function pointers.

Configuration

Commit: 855e296
OS: Tizen/armel
Application used for profiling: https://github.com/Samsung/Tizen-CSharp-Samples/tree/master/Wearable/Calculator

Data

Added JIT traces. Remove txt extension and open in PerfView
Calculator-fullni.nettrace.txt
Calculator-fullni_compilebubblegeneric.nettrace.txt
Calculator_crossgen1_fullni.nettrace.txt

cc @jkotas @gbalykov

@alpencolt alpencolt added the tenet-performance Performance related issue label Nov 19, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-crossgen2-coreclr untriaged New issue has not been triaged by the area owner labels Nov 19, 2020
@gbalykov
Copy link
Member

System.Private.CoreLib.dll compilation command:

${OVERLAY}/corerun ${OVERLAY}/crossgen2/crossgen2.dll -r:${OVERLAY}/* -r:${OVERLAY}/crossgen2/* ${CROSSGEN_OPTIONS} -o:$OVERLAY/System.Private.CoreLib.ni.dll $OVERLAY/System.Private.CoreLib.dll &>$OVERLAY/System.Private.CoreLib.dll.out

CROSSGEN_OPTIONS is -O for Calculator-fullni.nettrace.txt and -O --inputbubble --compilebubblegenerics for Calculator-fullni_compilebubblegeneric.nettrace.txt.

Command for other dlls is similar except that additional -r:... references are added if required.

@gbalykov
Copy link
Member

Also note, that next PR is required to correctly gather ETW events with env variables setup: #44068

@jkotas
Copy link
Member

jkotas commented Nov 19, 2020

cc @mangod9

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Nov 19, 2020
@mangod9 mangod9 added this to the 6.0.0 milestone Nov 19, 2020
@mangod9
Copy link
Member

mangod9 commented Nov 19, 2020

Thanks @alpencolt
cc @dotnet/crossgen-contrib @nattress since we have been recently comparing methods compiled by cg vs cg2

@alpencolt
Copy link
Author

@mangod9 I've also added trace for first crossgen (see updated issue). Other measurements performed for crossgen2.

@HJLeee
Copy link
Contributor

HJLeee commented Nov 20, 2020

@alpencolt Please share the procedure and commands you used for nettrace capture.

@gbalykov
Copy link
Member

Next command was used to capture jit etw events for app:

COMPlus_EnableEventPipe=1 COMPlus_EventPipeConfig="Microsoft-Windows-DotNETRuntime:0x10000210b8:5" COMPlus_EventPipeOutputPath=`pwd`/trace.nettrace COMPlus_EventPipeRundown=0 ./corerun $APP.dll

Before this one needs to compile all system and app dlls with command similar to SPC.dll above, and put them in the same dir. Also, Tizen app was modified to exit right when it appears on screen.

@davidwrighton
Copy link
Member

At this time, the .NET team is not prioritizing this work for the .NET 7 release. If a contributor provides fixes for these issues we may consider them, but the issue as a whole is moving to a future milestone.

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

7 participants