-
Notifications
You must be signed in to change notification settings - Fork 273
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
Make the ILLink benchmark much more realistic #3277
base: main
Are you sure you want to change the base?
Conversation
Previously we ran with copy default action (or the equivalence of that) - which is not the default for console/ASP.NET apps * Didn't test the setup which most people will experience * ILLink reported many warnings because the framework assumes certain code to be removed by it (due to feature switches and such), but that didn't always kick in due to the copy action * One upside of the previous setting was that the tests stressed the linker much more (especially the MarkStep) and thus the resulting duration is much more precise measuring marking performance as compared to the rest of the linker - effectively it emulated a much larger application. Fixed a wrong singlewarn- command line. Fixed feature switched. Updated feature switches to match the .NET 8 default for command line apps.
I'm in favor of keeping both. While the previous benchmark wasn't a realistic situation, it did have to analyze all the framework libraries, which covered more analysis scenarios and makes it useful for overall performance benchmarking of the linker. Since this is just a HelloWorld app, we're rooting a lot less and analyzing much less if we use 'trim'. I think both are valid scenarios to test and offer different insights into the performance.
Do you think we could remove that? The only benefit I could see from that test is that the arguments to the linker will be updated as we update the SDK. |
Agreed, I think we should keep both, at least until we have a more realistic benchmark that stresses the linker more than a helloworld with the default trimming settings. I think the |
Another idea is to:
|
The LinkTask is a ToolTask, which looks like it has some functionality to create a response file. Maybe we could have an option to write it to disk permanently and use that in this benchmark? That would have been helpful for debugging some issues in the past, too. |
Agreed, in fact I like the way ILCompiler does this (it always leaves the .rsp file in the intermediate directory). Relevant: dotnet/msbuild#4315. Maybe we should work around that and write the response file ourselves. |
Good point - let's solve the "repro" problem for the product first and then we can use it in the benchmarks. |
I don't see much risk in using a response file - we technically already do, but it's created in a temp directory and deleted each time by ToolTask: |
If we don't want to wait for msbuild, we could also override ExecuteTool and have a switch to just output the rsp file somewhere and skip actually running the linker. Then we wouldn't need to run the whole linker before doing it again in the benchmark. Or we could create a whole new task which just outputs the rsp file somewhere and shares code with the link task. |
Previously we ran with copy default action (or the equivalence of that) - which is not the default for console/ASP.NET apps
Fixed a wrong singlewarn- command line.
Fixed feature switched.
Updated feature switches to match the .NET 8 default for command line apps.
Marking this as a draft first since there's some discussion to be had:
Future considerations:
/cc Youssef1313