-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
tool_getparam: cmdline option parser refactor #12631
Closed
Closed
Conversation
This file contains 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
The most relevant speed tests I did with a manually added loop around the |
bagder
force-pushed
the
bagder/sorted-options
branch
3 times, most recently
from
January 4, 2024 22:13
d31e529
to
d720a56
Compare
bagder
changed the title
tool_getparam: bsearch cmdline options
tool_getparam: cmdline option parser refactor
Jan 5, 2024
bagder
force-pushed
the
bagder/sorted-options
branch
4 times, most recently
from
January 6, 2024 22:44
99113fd
to
f10fc64
Compare
bagder
added a commit
that referenced
this pull request
Jan 6, 2024
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
bagder
force-pushed
the
bagder/sorted-options
branch
from
January 7, 2024 14:00
cfa4bf7
to
720cc04
Compare
bagder
added a commit
that referenced
this pull request
Jan 7, 2024
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
bagder
added a commit
that referenced
this pull request
Jan 7, 2024
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
bagder
force-pushed
the
bagder/sorted-options
branch
from
January 7, 2024 22:33
720cc04
to
c1c908d
Compare
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
- easier to follow, easier to modify, easier to extend, possibly slightly faster - each case now has the long option as a comment
This function is not doing post at all so it was always weirdly placed.
use aprintf() instead
Saves ~11 bytes per option and simplifies the code.
To make the big switch much easier to read/understand and to make it easier to add new options.
bagder
force-pushed
the
bagder/sorted-options
branch
from
January 8, 2024 16:00
c1c908d
to
a725ab6
Compare
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.
the option names are now alpha sorted and lookup is a lot faster
use case sensitive matching. It was previously case insensitive, but that was not documented nor tested.
remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option
lookup short options via a table