Uh oh!
There was an error while loading. Please reload this page.
perf(all_variables_matching_prefix): avoid making list of all visible variables - #2
Open
akinomyoga wants to merge 4 commits into
Open
perf(all_variables_matching_prefix): avoid making list of all visible variables#2akinomyoga wants to merge 4 commits into
akinomyoga wants to merge 4 commits into
Conversation
akinomyogaforce-pushed
the
patch-all_variables_matching_prefix
branch
3 times, most recently
from
August 15, 2026 06:58
731cb35 to
2097031CompareThe original code probably does not cause any problems because the caller will correctly fill elements and put the NULL terminator. However, when we zero-initialize the contents, we should also initialize the NULL terminator.
The hint text can be used to reduce the size of the generated list. Filtering by the hint text is not mandatory. If the list is not too large, the list_getter function can safely ignore the hint_text argument. When list_getter fully performs the filtering by the hint text, list_getter can set flag LIST_PREFIXFILTERED so that the subsequent filtering at the caller can be skipped.
akinomyogaforce-pushed
the
patch-all_variables_matching_prefix
branch
2 times, most recently
from
August 15, 2026 10:35
4cc998b to
9c3169bCompare
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 freeto 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.
A global variable is used to pass the current context in this patch, but another option is to extend
vapplyto accept an additionalvoid*argument for a context that is passed to thefunctionargument. However, this requires extension ofmap_over,flatten, andsh_var_map_func_t, which is a part of the exposed interface. Then, one might need to prepare a full set of versions accepting a context argument, such asvapply_ctx,map_over_ctx,flattern_ctx,sh_var_map_func_ctx_t, which seems too much for the present change.Another possible improvement is to even reduce the construction of
vlistbecause we finally want to get a list of variable names. We can pass(VAR_LIST*)0toflattento avoid constructing a new variable list and instead append the variable name to the strvec in the map function. However, to do that, we need to manually loop overshell_variables. In addition, the properstrvec_sortisn't prepared, so we need to extendstrvec_sort. This possibility is implemented in d217f57.