Repository navigation
Perf improvements part 3 - #1510
Conversation
…are rounded to kb)
|
This is a great improvement! Some of these changes (using One change that I'm wondering about is the addition of the We've recently moved the name-based binding out into a separate package (System.CommandLine.NamingConventionBinder). The name matching functionality is partly there to support that but also to support validation of the parser, e.g. detect naming collisions that would make a command line unparseable. With that in mind, can you think of an approach that avoids introducing an interface? On a possibly related note, we've also discussed removing |
# Conflicts: # src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt # src/System.CommandLine/ISymbol.cs # src/System.CommandLine/Invocation/SuggestDirectiveResult.cs # src/System.CommandLine/Parsing/ParseResultExtensions.cs
Sure! I'll see what I can do and get back to you.
I am in favor of removing every abstraction that is implemented by a single type and|or is never implemented by the users. 👍 |
… Commands and Options remove WasBundled as it was not used anywhere
remove AliasedSet, don't verify aliases at model creation time remove ContainsAlias and GetByAlias as they are not needed since Token got extended with Symbol
…need to duplicate the logic around aliases
# Conflicts: # src/System.CommandLine.ApiCompatibility.Tests/ApiCompatibilityApprovalTests.System_CommandLine_api_is_not_changed.approved.txt # src/System.CommandLine/Argument.cs # src/System.CommandLine/Help/HelpBuilder.cs # src/System.CommandLine/Parsing/StringExtensions.cs # src/System.CommandLine/Parsing/SymbolResult.cs
…nds when they need to
1814cd6 to
34d8e8f
Compare
| { | ||
| if (ReferenceEquals(this, command)) | ||
| { | ||
| throw new ArgumentException("Parent can't be it's own child."); |
There was a problem hiding this comment.
I would suggest a different exception type.
Also, minor correction:
| throw new ArgumentException("Parent can't be it's own child."); | |
| throw new ArgumentException("Parent can't be its own child."); |
| /// </summary> | ||
| /// <remarks>Due to the performance impact of this method, it's recommended to create | ||
| /// a Unit Test that calls this method to verify the RootCommand of every application.</remarks> | ||
| public void Validate() |
There was a problem hiding this comment.
Let's discuss naming to make it clearer this is not about input validation.
* make Matches internal * make IsGlobal internal * make SymbolResult.Children readonly * add comment about complexity and perf * move Command.Validate to CommandLineConfiguration, delete the tests for now
@jonsequitur I am about to start my weekend now, so I am just opening the PR and providing benchmark results. On Monday I am going to describe why I've changed all of these things.