Closed aomathwift closed 3 years ago
Can someone review this patch? This changes will have good effect for my project. 🙏
My results (ran 3-5 times each, pretty consistent results):
Before: bundle exec xcversion list 0.93s user 0.48s system 58% cpu 2.407 total
After: bundle exec xcversion list 0.70s user 0.31s system 90% cpu 1.117 total
LGTM 🚀
Thank you for your contribution @aomathwift !
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.