Skip to content

Commit ea39e38

Browse files
committed
Add macos x64 data
1 parent 3b437fb commit ea39e38

4 files changed

Lines changed: 33 additions & 8 deletions

File tree

doc/int128/u128_benchmarks.adoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ image::../u128_graphs/windows/x64_relative_performance.png[x64 Relative Performa
8080

8181
=== ARM64 (Apple Silicon)
8282

83-
Clang-20
84-
8583
[cols="1,1,1,1"]
8684
|===
8785
| Operation | `unsigned __in128` | `uint128_t` | `boost::mp::uint128_t`
@@ -99,3 +97,19 @@ image::../u128_graphs/macos/ARM64_benchmarks.png[ARM64 Benchmark Results, width=
9997
image::../u128_graphs/macos/ARM64_relative_performance.png[ARM64 Relative Performance, width=100%]
10098

10199
=== x86_64
100+
101+
[cols="1,1,1,1"]
102+
|===
103+
| Operation | `unsigned __in128` | `uint128_t` | `boost::mp::uint128_t`
104+
105+
| Comparisons | 131902 | 133564 | 134182
106+
| Addition | 20613 | 17912 | 40176
107+
| Subtraction | 20484 | 18237 | 40311
108+
| Multiplication | 20160 | 20580 | 43285
109+
| Division | 686521 | 699201 | 945928
110+
| Modulo | 777084 | 724648 | 953117
111+
|===
112+
113+
image::../u128_graphs/macos/x64_benchmarks.png[x64 Benchmark Results, width=100%]
114+
115+
image::../u128_graphs/macos/x64_relative_performance.png[x64 Relative Performance, width=100%]

doc/plots.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,23 @@
3232
}
3333
"""
3434

35+
"""
36+
# ARM64 macOS
3537
data = {
3638
'Operation': ['Comparisons', 'Addition', 'Subtraction', 'Multiplication', 'Division', 'Modulo'],
3739
'unsigned __int128': [131902, 20613, 20484, 20160, 686521, 777084],
3840
'uint128_t': [133564, 17912, 18237, 20580, 699201, 724648],
3941
'boost::mp::uint128_t': [134182, 40176, 40311, 43285, 945928, 953117]
4042
}
43+
"""
44+
45+
# x64 macOS
46+
data = {
47+
'Operation': ['Comparisons', 'Addition', 'Subtraction', 'Multiplication', 'Division', 'Modulo'],
48+
'unsigned __int128': [688225, 104921, 129150, 120363, 2333812, 2621949],
49+
'uint128_t': [712352, 124992, 102302, 119652, 1981469, 2219481],
50+
'boost::mp::uint128_t': [689146, 137819, 153484, 164100, 2784139, 2736682]
51+
}
4152

4253
df = pd.DataFrame(data)
4354

@@ -76,7 +87,7 @@ def get_colors_by_rank(row):
7687

7788
ax1.set_xlabel('Operations', fontsize=12)
7889
ax1.set_ylabel('Time (nanoseconds)', fontsize=12)
79-
ax1.set_title('Clang 20 - ARM64 Benchmark Results', fontsize=14, fontweight='bold')
90+
ax1.set_title('Clang 15 - x64 Benchmark Results', fontsize=14, fontweight='bold')
8091
ax1.set_xticks(x)
8192
ax1.set_xticklabels(operations, rotation=45, ha='right')
8293
ax1.legend(loc='upper left')
@@ -105,15 +116,15 @@ def get_colors_by_rank(row):
105116

106117
ax2.set_xlabel('Operations', fontsize=12)
107118
ax2.set_ylabel('Time (nanoseconds) - Log Scale', fontsize=12)
108-
ax2.set_title('Clang 20 - ARM64 Benchmark Results (Log Scale)', fontsize=14, fontweight='bold')
119+
ax2.set_title('Clang 15 - x64 Benchmark Results (Log Scale)', fontsize=14, fontweight='bold')
109120
ax2.set_yscale('log')
110121
ax2.set_xticks(x)
111122
ax2.set_xticklabels(operations, rotation=45, ha='right')
112123
ax2.legend(loc='upper left')
113124
ax2.grid(axis='y', alpha=0.3, which='both')
114125

115126
plt.tight_layout()
116-
plt.savefig('ARM64_benchmarks.png', dpi=300, bbox_inches='tight')
127+
plt.savefig('x64_benchmarks.png', dpi=300, bbox_inches='tight')
117128
plt.show()
118129

119130
# Create a normalized performance chart
@@ -142,7 +153,7 @@ def get_colors_by_rank(row):
142153

143154
ax3.set_xlabel('Operations', fontsize=12)
144155
ax3.set_ylabel('Relative Performance (vs unsigned __int128)', fontsize=12)
145-
ax3.set_title('Relative Performance Comparison - ARM64', fontsize=14, fontweight='bold')
156+
ax3.set_title('Relative Performance Comparison - x64', fontsize=14, fontweight='bold')
146157
ax3.set_xticks(x)
147158
ax3.set_xticklabels(operations, rotation=45, ha='right')
148159
ax3.legend()
@@ -153,11 +164,11 @@ def get_colors_by_rank(row):
153164
fontsize=10, verticalalignment='top', style='italic')
154165

155166
plt.tight_layout()
156-
plt.savefig('ARM64_relative_performance.png', dpi=300, bbox_inches='tight')
167+
plt.savefig('x64_relative_performance.png', dpi=300, bbox_inches='tight')
157168
plt.show()
158169

159170
# Generate summary statistics
160-
print("\nPerformance Summary (ARM64):")
171+
print("\nPerformance Summary (x64):")
161172
print("-" * 50)
162173
for impl in implementations:
163174
if impl == 'unsigned __int128':
369 KB
Loading
202 KB
Loading

0 commit comments

Comments
 (0)