The same programs in both languages, both with automatic reference counting, built at four optimisation levels.
versionv0.6
platformarm64
runs per point3
benchmarks19
Each figure is the fastest of the runs. Every program times its own measured region with clock_gettime(CLOCK_MONOTONIC), so process startup and data setup are outside the number. Both programs print a checksum and a run is rejected if they disagree.
The arm64 Objective-C column is Apple's runtime and Foundation; the x86-64 column is libobjc2 and gnustep-base. Comparing a ratio across the two platforms therefore also compares two different Objective-C implementations, which matters most for the benchmarks dominated by allocation and dispatch.
Time by benchmark and optimisation level
xc arm64ObjC arm64xc x86-64ObjC x86-64ratio below 1 means xc is faster
benchmark
O0
O1
O2
O3
arm64
x86-64
arm64
x86-64
arm64
x86-64
arm64
x86-64
arc_alloc
1.52×
4.37×
1.60×
6.02×
1.54×
5.96×
1.51×
5.17×
arc_array
1.49×
0.88×
1.45×
1.41×
0.85×
0.47×
0.86×
0.49×
array_map
3.94×
1.49×
9.60×
4.28×
9.53×
2.61×
9.63×
2.63×
array_sum
0.98×
2.42×
2.26×
3.61×
1.04×
1.39×
1.03×
1.40×
bit_ops
3.59×
3.15×
5.61×
6.13×
4.60×
2.75×
4.33×
2.82×
branch_mix
3.31×
3.08×
5.72×
4.82×
4.25×
1.64×
4.39×
1.56×
call_depth
1.71×
1.12×
8.60×
5.67×
2.45×
6.12×
2.46×
6.13×
float_math
4.23×
1.61×
4.58×
8.39×
4.30×
5.98×
4.34×
6.01×
hash_mix
0.43×
1.01×
1.12×
1.01×
1.09×
1.09×
1.05×
1.12×
int_accum
1.14×
1.97×
1.56×
2.37×
3.71×
1.12×
3.75×
1.15×
int_muldiv
2.94×
0.87×
5.59×
3.73×
10.98×
3.66×
11.58×
3.88×
matrix_mul
3.02×
2.51×
7.91×
7.67×
11.63×
4.75×
12.58×
4.75×
mem_copy
6.01×
2.02×
13.03×
3.97×
9.39×
4.16×
9.97×
4.10×
method_call
0.40×
0.70×
0.45×
1.07×
0.54×
0.81×
0.47×
0.81×
poly_dispatch
1.31×
0.88×
2.16×
1.10×
1.42×
0.89×
1.44×
0.88×
sieve
1.23×
2.48×
2.73×
5.50×
1.73×
3.19×
1.81×
3.15×
sort_small
1.91×
3.05×
5.73×
6.13×
4.31×
3.33×
4.12×
3.66×
string_scan
2.35×
2.82×
6.42×
5.80×
23.65×
11.18×
23.72×
11.14×
struct_copy
1.43×
1.09×
10.46×
14.39×
9.46×
15.74×
10.17×
15.52×
Per benchmark
arc_alloc
arc_array
array_map
array_sum
bit_ops
branch_mix
call_depth
float_math
hash_mix
int_accum
int_muldiv
matrix_mul
mem_copy
method_call
poly_dispatch
sieve
sort_small
string_scan
struct_copy
Optimisations by target
Read from the compiler's target profiles when this page was rendered. A target that does not override a setting takes the base value.