Skip to content

Commit 1bacb16

Browse files
committed
1) Added a script to run XcodeBenchmark from Terminal
2) Updated ReadMe
1 parent 06e5e66 commit 1bacb16

File tree

3 files changed

+68
-16
lines changed

3 files changed

+68
-16
lines changed

ReadMe.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,34 @@ I believe the results will help developers to make the right *cost/performance*
3636

3737
- Download and install [Xcode](https://apps.apple.com/us/app/xcode/id497799835).
3838
- Open Xcode and install `additional tools` (Xcode should suggest it automatically).
39-
- Perform `defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES` in `Terminal` to show build time in the Xcode progress bar.
40-
- Download and unarchive [XcodeBenchmark](https://github.com/devMEremenko/XcodeBenchmark/archive/master.zip) project.
39+
- [Download](https://github.com/devMEremenko/XcodeBenchmark/archive/master.zip) and unarchive XcodeBenchmark project.
40+
- Change permissions of `benchmark.sh` to allow running in `Terminal`
41+
- Drag & drop `XcodeBenchmark` folder to `Terminal` app
42+
- Run `chmod 777 benchmark.sh` in Terminal
4143

4244
## Before each test
4345

44-
1. Select `XcodeBenchmark` -> `Generic iOS Device` in the top left corner.
45-
2. Close `XcodeBenchmark.xcworkspace` project.
46-
2. Remove the `DerivedData` folder, by selecting Finder, pressing `Shift + Command + G` and paste in the path: `~/Library/Developer/Xcode`, select the `DerivedData` folder and delete it.
47-
3. Disconnect a network cable and turn off WiFi.
48-
4. Make sure to disable all software running at startup: `System Preferences` -> `Users and Groups` -> `User` -> `Login Items` and empty the list.
49-
5. Reboot and cool down your Mac.
50-
6. Connect to the power adapter if you use MacBook.
46+
1. Disconnect a network cable and turn off WiFi.
47+
2. Make sure to disable all software running at startup
48+
- Go to `System Preferences` -> `Users and Groups` -> `User` -> `Login Items`.
49+
- Empty the list.
50+
3. Update `Energy Saver` settings
51+
- Go to `System Preferences` -> `Energy Saver` -> `Turn display off` and set 15 min.
52+
3. Reboot and cool down your Mac.
53+
4. Connect to the power adapter if you use MacBook.
5154

5255
## Running a test
5356

54-
1. Open `XcodeBenchmark.xcworkspace` (please do not confuse with `xcproject`).
55-
2. Press `Command B` to start compilation.
56-
57-
**Important: Start compilation as quickly as possible once you opened a project**
57+
1. Drag & drop `XcodeBenchmark` folder to `Terminal` app.
58+
2. Run `sh benchmark.sh` in `Terminal`.
59+
3. When `XcodeBenchmark` is complited you will see [this information](img/contribution-example.png).
60+
4. Upload your results, see [Contribution](https://github.com/devMEremenko/XcodeBenchmark#contribution) section.
5861

5962
## FAQ
6063

6164
**Q: What's inside?**
6265

63-
The framework that incudes **42** popular CocoaPods libraries and **70+** dependencies in total.
66+
A framework that includes **42** popular CocoaPods libraries and **70+** dependencies in total.
6467

6568
| Language | files | blank | comment | code |
6669
|---------------|-------|--------|---------|--------|
@@ -80,7 +83,7 @@ The framework that incudes **42** popular CocoaPods libraries and **70+** depend
8083

8184
**Q: What do the results mean?**
8285
1. First of all, the project is **huge**. I think the majority of projects have a smaller size.
83-
2. The results show *relative* performance in Xcode compared to other Macs under the same conditions.
86+
2. The results show *relative* performance in Xcode compared to other Macs under similar conditions.
8487

8588
**Q: Why is CocoaPods not excluded from git-repo?**
8689
- The project is also used by non-programmers. Let's *keep it simple*.
@@ -94,7 +97,7 @@ Make sure:
9497
- [All steps](https://github.com/devMEremenko/XcodeBenchmark#before-each-test) are performed
9598
- `Time` column is still sorted after insertion.
9699
- You are added to the end of the [Contributors](https://github.com/devMEremenko/XcodeBenchmark#contributors) list.
97-
- Attach a screenshot of the Xcode progress bar with a compilation time. [Example](https://user-images.githubusercontent.com/1449655/92333170-05f3f200-f073-11ea-94be-e0a41be5aae4.png).
100+
- Attach a screenshot with a compilation time. [Example](img/contribution-example.png).
98101
- The content in cells is centered. You can use [this tool](https://www.tablesgenerator.com/markdown_tables) to edit a table.
99102
- File -> Paste table data
100103
- Select all cells -> Right click -> Text align -> Center

benchmark.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
readonly PATH_TO_PROJECT=$(pwd)/XcodeBenchmark.xcworkspace
2+
3+
echo ""
4+
echo "Preparing environment"
5+
6+
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
7+
#rm -rf ~/Library/Developer/Xcode/DerivedData
8+
9+
if [ -n "$PATH_TO_PROJECT" ]; then
10+
11+
echo "Running XcodeBenchmark..."
12+
echo "Please do not use your Mac while XcodeBenchmark is in progress\n\n"
13+
14+
xcodebuild -workspace "$PATH_TO_PROJECT" \
15+
-scheme XcodeBenchmark \
16+
-destination generic/platform=iOS \
17+
build
18+
19+
echo "System Version:" "$(sw_vers -productVersion)"
20+
xcodebuild -version | grep "Xcode"
21+
22+
echo "Hardware Overview"
23+
system_profiler SPHardwareDataType | grep "Model Name:"
24+
system_profiler SPHardwareDataType | grep "Model Identifier:"
25+
26+
system_profiler SPHardwareDataType | grep "Processor Name:"
27+
system_profiler SPHardwareDataType | grep "Processor Speed:"
28+
system_profiler SPHardwareDataType | grep "Total Number of Cores:"
29+
30+
system_profiler SPHardwareDataType | grep "L2 Cache (per Core):"
31+
system_profiler SPHardwareDataType | grep "L3 Cache:"
32+
33+
system_profiler SPHardwareDataType | grep "Number of Processors:"
34+
system_profiler SPHardwareDataType | grep "Hyper-Threading Technology:"
35+
36+
system_profiler SPHardwareDataType | grep "Memory:"
37+
38+
echo ""
39+
echo "✅ XcodeBenchmark is completed"
40+
echo "1️⃣ Take a screenshot of this window (Cmd + Shift + 4 + Space), it must include:"
41+
echo "\t- Build Time (See ** BUILD SUCCEEDED ** [XYZ sec])"
42+
echo "\t- System Version"
43+
echo "\t- Xcode Version"
44+
echo "\t- Hardware Overview"
45+
echo "2️⃣ Share your results at https://github.com/devMEremenko/XcodeBenchmark"
46+
else
47+
echo "XcodeBenchmark.xcworkspace was not found in the current folder"
48+
echo "Are you running in the XcodeBenchmark folder?"
49+
fi

img/contribution-example.png

169 KB
Loading

0 commit comments

Comments
 (0)