Work around slow path searches on MacOS #571
Merged
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.
If a directory under /home was in $PATH on MacOS, the path search for
sed
was surprisingly slow. One an M1 MBP, adding/home/missing
to$PATH caused
mix firmware
to regularly take >40 seconds. Without thatin the $PATH,
mix firmware
almost always takes 10 or 11 seconds.See the conversation at
https://elixirforum.com/t/mix-firmware-takes-very-long-time-to-run-how-to-debug/41201
for much, much worse experience on a different MBP. A huge thanks to
jpalley for figuring out that the slowdown was correlated with the
/home
directory in the path.This PR caches the absolute path to sed to avoid searching
$PATH
eachtime. On an M1 MBP, this reduces the
mix firmware
time from 40 secondsto about 11 seconds.