perf(UnionCaseArgInfo): Flatten Name / CommandLineNames / AppSettingsName#310
Open
dimension-zero wants to merge 1 commit into
Open
Conversation
…Name Three more fields graduate from Lazy<_> to the strict value, matching the pattern of pr/01-lazy-bool-flatten which did the same for the seven bool-valued fields. These three are forced on every parse and every help rendering, so the Lazy wrapper was pure overhead. * UnionArgInfo.fs: field types are now string, string list, string option. IsCommandLineArg reads the strict list directly. ToArgumentCaseInfo() wraps the strict values with 'lazy v' so the public ArgumentCaseInfo shape (Lazy<_>) is preserved verbatim. * PreCompute.fs: commandLineArgs, appSettingsName and defaultName are computed strictly at construction. The dependency between them is unchanged. The trailing checkStructure force-evaluations for these three fields are dropped (no lazy left to force). * Cli.fs / KeyValue.fs / Common.fs / UnParsers.fs / ParseResults.fs: drop .Value reads on the now-strict fields. Roughly 20 call sites. All 112 tests pass unchanged. Public ArgumentCaseInfo unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
perf(UnionCaseArgInfo): Flatten Name / CommandLineNames / AppSettingsName
Three more fields graduate from Lazy<_> to the strict value, matching
the pattern of pr/01-lazy-bool-flatten which did the same for the seven
bool-valued fields. These three are forced on every parse and every
help rendering, so the Lazy wrapper was pure overhead.
IsCommandLineArg reads the strict list directly.
ToArgumentCaseInfo() wraps the strict values with 'lazy v' so the
public ArgumentCaseInfo shape (Lazy<_>) is preserved verbatim.
computed strictly at construction. The dependency between them is
unchanged. The trailing checkStructure force-evaluations for these
three fields are dropped (no lazy left to force).
drop .Value reads on the now-strict fields. Roughly 20 call sites.
All 112 tests pass unchanged. Public ArgumentCaseInfo unchanged.