Skip to content

Conversation

adamsitnik
Copy link
Member

I am currently writing the Threat Model for S.CL and when describing the Reflection usage I've realized that:

  • ArgumentBuilder and OptionBuilder can be removed, as they are no longer used by the product (I suspect they were used by some of the libs we have removed recently)
  • RootCommand does not need to define an Assembly field, which forces the JIT to load and compile more types when RootCommand is used for the first time. Since we care about startup perf, I've moved it to VersionOptionAction, which will be lazy used when needed

public override CommandLineAction? Action
{
get => _action ??= new VersionOptionAction();

…mmand to VersionOption:

- make it clear when Reflection is used
- don't load and compile Assembly type when RootCommand is used for the first time
Copy link
Contributor

@jonsequitur jonsequitur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@adamsitnik adamsitnik merged commit ec61e86 into dotnet:main Aug 13, 2025
10 checks passed
@adamsitnik adamsitnik deleted the removeUnusedCode branch August 13, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants