wg-quick: linux: use sed for trimming config lines #9
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.
Bash's longest matching operators combined with extended globs is
extremely slow for very large lines. There are probably very few people
for which this is noticable but in a file with 800 AllowIPs on a single
line it keeps wg-quick from stalling for 5s when performing operations.
I'm not sure about the portability of this to other platforms beyond gnu linux.
My understanding is the multiple
-e
flag style is the most portable and availableon non-gnu systems but I have not tested.
I didnt see any performance regression but perhaps shelling out to sed is slower
if your config has thousands of lines. I suspect its not.