improve version fetching command performance by reading Xcode's version.plist instead of using the xcodebuild
command
#427
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.
closes #273
Currently It takes a few ms to run
XcodeInstall::Installer.installed_versions
. The cause seems to be thatxcodebuild
command is executed directly infetch_version
method.Therefore, I refer to #273 and change to parse and read the version.plist inside the Xcode.app to detect Xcode version.
For example, if you run
xcversion list
from CLI and measure the execution time with thetime
command, the execution time changes as follows:Before improvement:
xcversion list 3.30s user 2.92s system 40% cpu 15.412 total
After improvement:
xcversion list 1.58s user 0.47s system 96% cpu 2.127 total
As you can see, the execution time has been halved.