You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,34 +22,36 @@ An example on Linux with b2: `../../../b2 cxxstd=20 toolset=gcc-13 define=BOOST_
22
22
23
23
== Comparisons
24
24
25
-
The benchmark for comparisons generates a random vector containing 10,000,000 elements and does operations `>`, `>=`, `<`, `<=`, `==`, and `!=` between `vec[i] and vec[i + 1]`.
25
+
The benchmark for comparisons generates a random vector containing 2,000,000 elements and does operations `>`, `>=`, `<`, `<=`, `==`, and `!=` between `vec[i] and vec[i + 1]`.
26
+
This is repeated 5 times to generate stable results.
26
27
27
28
=== M1 macOS Results
28
29
29
30
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
30
31
31
32
|===
32
-
| Type | Runtime (ms) | Ratio to `double`
33
+
| Type | Runtime (us) | Ratio to `double`
33
34
| `float`
34
-
| 8
35
-
| 1.333
35
+
| 9032
36
+
| 1.589
36
37
| `double`
37
-
| 6
38
+
| 5684
38
39
| 1.000
39
40
| `decimal32`
40
-
| 380
41
-
| 63.333
41
+
| 285,453
42
+
| 50.2204
42
43
| `decimal64`
43
-
| 408
44
-
| 608.000
44
+
| 352,644
45
+
| 62.042
45
46
| `decimal128`
46
-
| 14641
47
-
| 2440.170
47
+
| 15,355,817
48
+
| 2701.590
48
49
|===
49
50
50
51
== Basic Operations
51
52
52
-
The benchmark for these operations generates a random vector containing 10,000,000 elements and does operations `+`, `-`, `*`, `/` between `vec[i] and vec[i + 1]`.
53
+
The benchmark for these operations generates a random vector containing 2,000,000 elements and does operations `+`, `-`, `*`, `/` between `vec[i] and vec[i + 1]`.
54
+
This is repeated 5 times to generate stable results.
53
55
54
56
=== M1 macOS Results
55
57
@@ -58,83 +60,275 @@ Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and home
58
60
==== Addition
59
61
60
62
|===
61
-
| Type | Runtime (ms) | Ratio to `double`
63
+
| Type | Runtime (us) | Ratio to `double`
62
64
| `float`
63
-
| 6
64
-
| 1.500
65
+
| 1641
66
+
| 0.965
65
67
| `double`
66
-
| 4
68
+
| 1708
67
69
| 1.000
68
70
| `decimal32`
69
-
| 361
70
-
| 90.250
71
+
| 378,252
72
+
| 221.459
71
73
| `decimal64`
72
-
| 568
73
-
| 142.000
74
+
| 589,313
75
+
| 345.031
74
76
| `decimal128`
75
-
| 13428
76
-
| 3357.000
77
+
| 13,829,995
78
+
| 8097.190
77
79
|===
78
80
79
81
==== Subtraction
80
82
81
83
|===
82
-
| Type | Runtime (ms) | Ratio to `double`
84
+
| Type | Runtime (us) | Ratio to `double`
83
85
| `float`
84
-
| 3
85
-
| 3.000
86
+
| 3633
87
+
| 2.221
86
88
| `double`
87
-
| 1
89
+
| 1636
88
90
| 1.000
89
91
| `decimal32`
90
-
| 307
91
-
| 307.000
92
+
| 307,765
93
+
| 188.120
92
94
| `decimal64`
93
-
| 465
94
-
| 465.000
95
+
| 461,442
96
+
| 282.055
95
97
| `decimal128`
96
-
| 11444
97
-
| 11444.000
98
+
| 11,449,306
99
+
| 6998.350
98
100
|===
99
101
100
102
==== Multiplication
101
103
102
104
|===
103
-
| Type | Runtime (ms) | Ratio to `double`
105
+
| Type | Runtime (us) | Ratio to `double`
104
106
| `float`
105
-
| 1
106
-
| 0.333
107
+
| 1678
108
+
| 0.523
107
109
| `double`
108
-
| 3
110
+
| 3209
109
111
| 1.000
110
112
| `decimal32`
111
-
| 311
112
-
| 103.667
113
+
| 310,543
114
+
| 96.773
113
115
| `decimal64`
114
-
| 569
115
-
| 189.667
116
+
| 570,938
117
+
| 177.918
116
118
| `decimal128`
117
-
| 9430
118
-
| 3143.330
119
+
| 9,434,297
120
+
| 2939.95
119
121
|===
120
122
121
123
==== Division
122
124
123
125
|===
124
-
| Type | Runtime (ms) | Ratio to `double`
126
+
| Type | Runtime (us) | Ratio to `double`
125
127
| `float`
126
-
| 2
127
-
| 0.667
128
+
| 2019
129
+
| 0.565
128
130
| `double`
129
-
| 3
131
+
| 3572
130
132
| 1.000
131
133
| `decimal32`
132
-
| 319
133
-
| 106.333
134
+
| 322,116
135
+
| 90.178
134
136
| `decimal64`
135
-
| 395
136
-
| 131.667
137
+
| 734,173
138
+
| 205.536
137
139
| `decimal128`
138
-
| 14781
139
-
| 4927.000
140
+
| 14,592,284
141
+
| 4085.19
142
+
|===
143
+
144
+
== Selected Special Functions
145
+
146
+
The benchmark for these operations generates a random vector containing 2,000,000 elements and does operations `+`, `-`, `*`, `/` between `vec[i] and vec[i + 1]`.
147
+
This is repeated 5 times to generate stable results.
148
+
149
+
=== M1 macOS Results
150
+
151
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
152
+
153
+
==== SQRT
154
+
155
+
|===
156
+
| Type | Runtime (us) | Ratio to `double`
157
+
| `float`
158
+
| 1904
159
+
| 0.565
160
+
| `double`
161
+
| 3746
162
+
| 1.000
163
+
| `decimal32`
164
+
| 5,050,241
165
+
| 1341.72
166
+
| `decimal64`
167
+
| 12,084,821
168
+
| 3210.630
169
+
| `decimal128`
170
+
| 275,779,340
171
+
| 73267.60
172
+
|===
173
+
174
+
== `<charconv>`
175
+
176
+
For all the following the results compare against https://github.com/boostorg/charconv[boost.charconv] for 10'000'000 conversions.
177
+
178
+
=== `from_chars` general
179
+
180
+
==== M1 macOS Results
181
+
182
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
183
+
184
+
|===
185
+
| Type | Runtime (us) | Ratio to `double`
186
+
| `float`
187
+
| 235,816
188
+
| 0.953
189
+
| `double`
190
+
| 247,307
191
+
| 1.000
192
+
| `decimal32`
193
+
| 366,682
194
+
| 1.483
195
+
| `decimal64`
196
+
| 485,965
197
+
| 1.965
198
+
// Decimal128 was two orders of magnitude faster. I expect an issue
199
+
//| `decimal128`
200
+
//| 275,779,340
201
+
//| 73267.60
202
+
|===
203
+
204
+
NOTE: `decimal128` is currently absent due to results showing it is 2 orders of magnitude faster than the others.
205
+
This should not be the case so will be investigated.
206
+
207
+
=== `from_chars` scientific
208
+
209
+
==== M1 macOS Results
210
+
211
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
212
+
213
+
|===
214
+
| Type | Runtime (us) | Ratio to `double`
215
+
| `float`
216
+
| 241,893
217
+
| 0.975
218
+
| `double`
219
+
| 247,975
220
+
| 1.000
221
+
| `decimal32`
222
+
| 358,189
223
+
| 1.444
224
+
| `decimal64`
225
+
| 477,574
226
+
| 1.926
227
+
// Decimal128 was two orders of magnitude faster. I expect an issue
228
+
//| `decimal128`
229
+
//| 275,779,340
230
+
//| 73267.60
231
+
|===
232
+
233
+
NOTE: `decimal128` is currently absent due to results showing it is 2 orders of magnitude faster than the others.
234
+
This should not be the case so will be investigated.
235
+
236
+
=== `to_chars` general shortest representation
237
+
238
+
==== M1 macOS Results
239
+
240
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
241
+
242
+
|===
243
+
| Type | Runtime (us) | Ratio to `double`
244
+
| `float`
245
+
| 316,300
246
+
| 1.040
247
+
| `double`
248
+
| 304,272
249
+
| 1.000
250
+
| `decimal32`
251
+
| 406,053
252
+
| 1.335
253
+
| `decimal64`
254
+
| 678,451
255
+
| 2.230
256
+
| `decimal128`
257
+
| 6,309,346
258
+
| 20.736
259
+
|===
260
+
261
+
=== `to_chars` general 6-digits of precision
262
+
263
+
==== M1 macOS Results
264
+
265
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
266
+
267
+
|===
268
+
| Type | Runtime (us) | Ratio to `double`
269
+
| `float`
270
+
| 323,867
271
+
| 0.967
272
+
| `double`
273
+
| 334,989
274
+
| 1.000
275
+
| `decimal32`
276
+
| 409,608
277
+
| 1.223
278
+
| `decimal64`
279
+
| 702,339
280
+
| 2.097
281
+
| `decimal128`
282
+
| 6,305,521
283
+
| 18.823
284
+
|===
285
+
286
+
=== `to_chars` scientific shortest representation
287
+
288
+
==== M1 macOS Results
289
+
290
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
291
+
292
+
|===
293
+
| Type | Runtime (us) | Ratio to `double`
294
+
| `float`
295
+
| 286,330
296
+
| 1.011
297
+
| `double`
298
+
| 283,287
299
+
| 1.000
300
+
| `decimal32`
301
+
| 290,117
302
+
| 1.024
303
+
| `decimal64`
304
+
| 499,637
305
+
| 1.764
306
+
| `decimal128`
307
+
| 3,096,910
308
+
| 10.932
309
+
|===
310
+
311
+
=== `to_chars` scientific 6-digits of precision
312
+
313
+
==== M1 macOS Results
314
+
315
+
Run using a Macbook pro with M1 pro chipset running macOS Sonoma 14.4.1 and homebrew Clang 18.1.4
0 commit comments