Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift build system #285

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ I believe the results will help developers to make the right *cost/performance*
PR merging will be performed on a best-effort basis.
If a device you are looking for is not on the list below, check out open [issues](https://github.com/devMEremenko/XcodeBenchmark/issues) and [PRs](https://github.com/devMEremenko/XcodeBenchmark/pulls).

## Xcode 13.2 or above, using the Swift Build System

| Device | CPU | RAM | SSD | HDD | Xcode | macOS | Time(sec) |
|:--------------------:|:-----------------------:|:---:|:---:|:---:|:-----:|:-------:|:---------:|
| MacBook Pro 14" 2021 | M1 Max 10-core | 64 | 2TB | | 13.2 | 12.0.1 | 88 |

## Xcode 13.0 or above

| Device | CPU | RAM | SSD | HDD | Xcode | macOS | Time(sec) |
Expand Down
25 changes: 19 additions & 6 deletions benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ clear

echo "Preparing environment"

START_TIME=$(date +"%T")

readonly duration=$(defaults read com.apple.dt.Xcode ShowBuildOperationDuration)
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES

# We should build with the new build system
readonly swift_build_system=$(defaults read com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration)
defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration YES

START_TIME=$(date +"%T")

if [ -n "$PATH_TO_PROJECT" ]; then

echo "Running XcodeBenchmark..."
echo "Please do not use your Mac while XcodeBenchmark is in progress\n\n"
echo "Please do not use your Mac while XcodeBenchmark is in progress\n\n"
echo "Running XcodeBenchmark...\n\n"

xcodebuild -workspace "$PATH_TO_PROJECT" \
-scheme XcodeBenchmark \
Expand All @@ -23,6 +28,8 @@ if [ -n "$PATH_TO_PROJECT" ]; then
echo "System Version:" "$(sw_vers -productVersion)"
xcodebuild -version | grep "Xcode"

echo "Swift Build System:" "$(defaults read com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration)"

echo "Hardware Overview"
system_profiler SPHardwareDataType | grep "Model Name:"
system_profiler SPHardwareDataType | grep "Model Identifier:"
Expand Down Expand Up @@ -55,8 +62,14 @@ if [ -n "$PATH_TO_PROJECT" ]; then
echo "2️⃣ Share your results at https://github.com/devMEremenko/XcodeBenchmark"

rm -rfd "$PATH_TO_DERIVED"

# Return environment to previous state
defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration "$swift_build_system"
defaults write com.apple.dt.Xcode ShowBuildOperationDuration "$duration"

echo ""

else
echo "XcodeBenchmark.xcworkspace was not found in the current folder"
echo "Are you running in the XcodeBenchmark folder?"
echo "XcodeBenchmark.xcworkspace was not found in the current folder\n"
echo "Are you running in the XcodeBenchmark folder?\n"
fi
1 change: 1 addition & 0 deletions pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**If you have any non-Apple hardware components - submit your results to the `Custom Hardware` table.**

* [ ] I performed [all steps](https://github.com/devMEremenko/XcodeBenchmark#before-each-test) to correctly run XcodeBenchmark.
* [ ] I am not overclocking or doing something else to increase my build time beyond what normal users would experience.
* [ ] I used Xcode 12.5 or above.
* [ ] I attached a screenshot with a compilation time and other fields, [example](img/contribution-example.png).
* [ ] I confirm that `Time` column is still sorted.
Expand Down