forked from fastruby/fast-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruby-3.1.4.fastruby
922 lines (800 loc) · 40.1 KB
/
ruby-3.1.4.fastruby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
$ ruby -v code/general/array-argument-vs-splat-arguments.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Function with single Array argument
759.909k i/100ms
Function with splat arguments
26.831k i/100ms
Calculating -------------------------------------
Function with single Array argument
7.667M (± 0.3%) i/s - 38.755M in 5.055081s
Function with splat arguments
248.386k (± 7.3%) i/s - 1.234M in 5.001360s
Comparison:
Function with single Array argument: 7666706.6 i/s
Function with splat arguments: 248385.9 i/s - 30.87x (± 0.00) slower
$ ruby -v code/general/assignment.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Parallel Assignment 1.012M i/100ms
Sequential Assignment
1.001M i/100ms
Calculating -------------------------------------
Parallel Assignment 10.066M (± 0.3%) i/s - 50.589M in 5.025603s
Sequential Assignment
10.087M (± 0.5%) i/s - 51.041M in 5.060073s
Comparison:
Sequential Assignment: 10087331.4 i/s
Parallel Assignment: 10066378.3 i/s - same-ish: difference falls within error
$ ruby -v code/general/attr-accessor-vs-getter-and-setter.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
getter_and_setter 463.384k i/100ms
attr_accessor 548.854k i/100ms
Calculating -------------------------------------
getter_and_setter 4.658M (± 0.4%) i/s - 23.633M in 5.073487s
attr_accessor 5.468M (± 0.6%) i/s - 27.443M in 5.019377s
Comparison:
attr_accessor: 5467563.6 i/s
getter_and_setter: 4658125.0 i/s - 1.17x (± 0.00) slower
$ ruby -v code/general/begin-rescue-vs-respond-to.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
begin...rescue 88.657k i/100ms
respond_to? 765.704k i/100ms
Calculating -------------------------------------
begin...rescue 882.052k (± 0.8%) i/s - 4.433M in 5.025923s
respond_to? 7.612M (± 0.5%) i/s - 38.285M in 5.029620s
Comparison:
respond_to?: 7612127.0 i/s
begin...rescue: 882051.6 i/s - 8.63x (± 0.00) slower
$ ruby -v code/general/block-apply-method.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
normal 292.840k i/100ms
&method 121.282k i/100ms
Calculating -------------------------------------
normal 2.963M (± 1.6%) i/s - 14.935M in 5.042167s
&method 1.186M (± 5.3%) i/s - 5.943M in 5.030514s
Comparison:
normal: 2962761.6 i/s
&method: 1186466.6 i/s - 2.50x (± 0.00) slower
$ ruby -v code/general/define_method-vs-module-eval.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
module_eval with string
241.000 i/100ms
define_method 310.000 i/100ms
Calculating -------------------------------------
module_eval with string
2.315k (±16.8%) i/s - 10.845k in 5.020965s
define_method 3.116k (±18.7%) i/s - 14.260k in 5.058668s
Comparison:
define_method: 3116.2 i/s
module_eval with string: 2314.6 i/s - same-ish: difference falls within error
$ ruby -v code/general/format-vs-round-and-to-s.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Float#round 260.748k i/100ms
Kernel#format 204.377k i/100ms
String#% 175.807k i/100ms
Calculating -------------------------------------
Float#round 2.650M (± 0.4%) i/s - 13.298M in 5.018038s
Kernel#format 2.039M (± 0.2%) i/s - 10.219M in 5.010757s
String#% 1.780M (± 0.2%) i/s - 8.966M in 5.036095s
Comparison:
Float#round: 2650119.2 i/s
Kernel#format: 2039391.9 i/s - 1.30x (± 0.00) slower
String#%: 1780385.3 i/s - 1.49x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct-on-access.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash 902.696k i/100ms
OpenStruct 499.485k i/100ms
Calculating -------------------------------------
Hash 8.895M (± 0.7%) i/s - 45.135M in 5.074163s
OpenStruct 4.992M (± 0.4%) i/s - 24.974M in 5.002594s
Comparison:
Hash: 8895431.9 i/s
OpenStruct: 4992341.1 i/s - 1.78x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash 1.089M i/100ms
OpenStruct 11.302k i/100ms
Calculating -------------------------------------
Hash 11.608M (± 0.3%) i/s - 58.808M in 5.066212s
OpenStruct 114.744k (± 2.7%) i/s - 576.402k in 5.026944s
Comparison:
Hash: 11607988.9 i/s
OpenStruct: 114744.3 i/s - 101.16x (± 0.00) slower
$ ruby -v code/general/inheritance-check.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
less than or equal 554.377k i/100ms
ancestors.include? 123.307k i/100ms
Calculating -------------------------------------
less than or equal 5.971M (± 0.2%) i/s - 29.936M in 5.013601s
ancestors.include? 1.230M (± 1.2%) i/s - 6.165M in 5.011962s
Comparison:
less than or equal: 5971059.8 i/s
ancestors.include?: 1230311.4 i/s - 4.85x (± 0.00) slower
$ ruby -v code/general/loop-vs-while-true.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
While Loop 1.000 i/100ms
Kernel loop 1.000 i/100ms
Calculating -------------------------------------
While Loop 0.705 (± 0.0%) i/s - 4.000 in 5.723636s
Kernel loop 0.214 (± 0.0%) i/s - 2.000 in 9.332394s
Comparison:
While Loop: 0.7 i/s
Kernel loop: 0.2 i/s - 3.29x (± 0.00) slower
$ ruby -v code/general/raise-vs-e2mmap.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
$ ruby -v code/array/array-first-vs-index.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#[0] 1.479M i/100ms
Array#first 1.296M i/100ms
Calculating -------------------------------------
Array#[0] 14.773M (± 0.3%) i/s - 73.970M in 5.007106s
Array#first 12.944M (± 0.4%) i/s - 64.821M in 5.008018s
Comparison:
Array#[0]: 14773115.9 i/s
Array#first: 12943560.4 i/s - 1.14x (± 0.00) slower
$ ruby -v code/array/array-last-vs-index.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#[-1] 1.540M i/100ms
Array#last 1.321M i/100ms
Calculating -------------------------------------
Array#[-1] 15.496M (± 1.0%) i/s - 78.533M in 5.068418s
Array#last 12.996M (± 0.5%) i/s - 66.036M in 5.081411s
Comparison:
Array#[-1]: 15496417.8 i/s
Array#last: 12995878.8 i/s - 1.19x (± 0.00) slower
$ ruby -v code/array/bsearch-vs-find.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
find 1.000 i/100ms
bsearch 89.610k i/100ms
Calculating -------------------------------------
find 0.267 (± 0.0%) i/s - 2.000 in 7.478484s
bsearch 894.320k (± 0.9%) i/s - 4.480M in 5.010398s
Comparison:
bsearch: 894319.5 i/s
find: 0.3 i/s - 3344061.59x (± 0.00) slower
$ ruby -v code/array/insert-vs-unshift.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#unshift 18.000 i/100ms
Array#insert 1.000 i/100ms
Calculating -------------------------------------
Array#unshift 190.759 (± 2.6%) i/s - 954.000 in 5.003969s
Array#insert 1.447 (± 0.0%) i/s - 8.000 in 5.527681s
Comparison:
Array#unshift: 190.8 i/s
Array#insert: 1.4 i/s - 131.80x (± 0.00) slower
$ ruby -v code/array/length-vs-size-vs-count.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#length 2.131M i/100ms
Array#size 2.131M i/100ms
Array#count 1.635M i/100ms
Calculating -------------------------------------
Array#length 21.296M (± 0.8%) i/s - 106.542M in 5.003197s
Array#size 20.908M (± 0.7%) i/s - 106.563M in 5.097090s
Array#count 16.341M (± 0.3%) i/s - 81.732M in 5.001644s
Comparison:
Array#length: 21296129.1 i/s
Array#size: 20907821.9 i/s - 1.02x (± 0.00) slower
Array#count: 16341108.8 i/s - 1.30x (± 0.00) slower
$ ruby -v code/array/shuffle-first-vs-sample.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#shuffle.first 45.769k i/100ms
Array#sample 1.021M i/100ms
Calculating -------------------------------------
Array#shuffle.first 454.629k (± 0.7%) i/s - 2.288M in 5.033916s
Array#sample 10.302M (± 0.6%) i/s - 52.060M in 5.053483s
Comparison:
Array#sample: 10302196.0 i/s
Array#shuffle.first: 454629.5 i/s - 22.66x (± 0.00) slower
$ ruby -v code/date/iso8601-vs-parse.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Date.iso8601 64.086k i/100ms
Date.parse 32.533k i/100ms
Calculating -------------------------------------
Date.iso8601 639.990k (± 0.3%) i/s - 3.204M in 5.006851s
Date.parse 323.627k (± 0.6%) i/s - 1.627M in 5.026491s
Comparison:
Date.iso8601: 639990.4 i/s
Date.parse: 323626.6 i/s - 1.98x (± 0.00) slower
$ ruby -v code/enumerable/each-push-vs-map.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#each + push 18.735k i/100ms
Array#map 25.643k i/100ms
Calculating -------------------------------------
Array#each + push 186.263k (± 0.6%) i/s - 936.750k in 5.029383s
Array#map 255.427k (± 1.7%) i/s - 1.282M in 5.021169s
Comparison:
Array#map: 255426.9 i/s
Array#each + push: 186263.4 i/s - 1.37x (± 0.00) slower
$ ruby -v code/enumerable/each-vs-for-loop.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
For loop 28.219k i/100ms
#each 30.750k i/100ms
Calculating -------------------------------------
For loop 282.681k (± 1.6%) i/s - 1.439M in 5.092463s
#each 306.866k (± 0.5%) i/s - 1.538M in 5.010436s
Comparison:
#each: 306866.3 i/s
For loop: 282681.4 i/s - 1.09x (± 0.00) slower
$ ruby -v code/enumerable/each_with_index-vs-while-loop.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
While Loop 28.083k i/100ms
each_with_index 18.143k i/100ms
Calculating -------------------------------------
While Loop 275.729k (± 0.3%) i/s - 1.404M in 5.092558s
each_with_index 181.565k (± 0.4%) i/s - 925.293k in 5.096306s
Comparison:
While Loop: 275728.7 i/s
each_with_index: 181564.8 i/s - 1.52x (± 0.00) slower
$ ruby -v code/enumerable/inject-symbol-vs-block.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
inject symbol 124.598k i/100ms
inject to_proc 1.761k i/100ms
inject block 1.962k i/100ms
Calculating -------------------------------------
inject symbol 1.240M (± 0.7%) i/s - 6.230M in 5.023224s
inject to_proc 17.627k (± 1.0%) i/s - 89.811k in 5.095594s
inject block 19.822k (± 0.2%) i/s - 100.062k in 5.048042s
Comparison:
inject symbol: 1240274.5 i/s
inject block: 19822.1 i/s - 62.57x (± 0.00) slower
inject to_proc: 17627.0 i/s - 70.36x (± 0.00) slower
$ ruby -v code/enumerable/map-flatten-vs-flat_map.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#map.flatten(1) 7.055k i/100ms
Array#map.flatten 4.191k i/100ms
Array#flat_map 8.999k i/100ms
Calculating -------------------------------------
Array#map.flatten(1) 70.297k (± 1.5%) i/s - 352.750k in 5.019171s
Array#map.flatten 41.884k (± 0.9%) i/s - 209.550k in 5.003548s
Array#flat_map 89.925k (± 0.5%) i/s - 449.950k in 5.003740s
Comparison:
Array#flat_map: 89925.2 i/s
Array#map.flatten(1): 70297.4 i/s - 1.28x (± 0.00) slower
Array#map.flatten: 41883.7 i/s - 2.15x (± 0.00) slower
$ ruby -v code/enumerable/reverse-each-vs-reverse_each.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Array#reverse.each 30.801k i/100ms
Array#reverse_each 31.670k i/100ms
Calculating -------------------------------------
Array#reverse.each 308.008k (± 0.4%) i/s - 1.540M in 5.000115s
Array#reverse_each 316.051k (± 0.5%) i/s - 1.584M in 5.010388s
Comparison:
Array#reverse_each: 316050.9 i/s
Array#reverse.each: 308007.6 i/s - 1.03x (± 0.00) slower
$ ruby -v code/enumerable/select-first-vs-detect.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Enumerable#select.first
20.344k i/100ms
Enumerable#detect 82.110k i/100ms
Calculating -------------------------------------
Enumerable#select.first
202.838k (± 0.5%) i/s - 4.069M in 20.059888s
Enumerable#detect 819.076k (± 0.3%) i/s - 16.422M in 20.049655s
Comparison:
Enumerable#detect: 819076.5 i/s
Enumerable#select.first: 202838.3 i/s - 4.04x (± 0.00) slower
$ ruby -v code/enumerable/select-last-vs-reverse-detect.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Enumerable#reverse.detect
244.211k i/100ms
Enumerable#select.last
18.384k i/100ms
Calculating -------------------------------------
Enumerable#reverse.detect
2.458M (± 0.8%) i/s - 12.455M in 5.066721s
Enumerable#select.last
185.496k (± 0.4%) i/s - 937.584k in 5.054552s
Comparison:
Enumerable#reverse.detect: 2458294.6 i/s
Enumerable#select.last: 185495.7 i/s - 13.25x (± 0.00) slower
$ ruby -v code/enumerable/sort-vs-sort_by.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Enumerable#sort_by (Symbol#to_proc)
5.186k i/100ms
Enumerable#sort_by 4.968k i/100ms
Enumerable#sort 2.401k i/100ms
Calculating -------------------------------------
Enumerable#sort_by (Symbol#to_proc)
52.063k (± 1.0%) i/s - 264.486k in 5.080607s
Enumerable#sort_by 50.011k (± 1.0%) i/s - 253.368k in 5.066814s
Enumerable#sort 23.862k (± 0.5%) i/s - 120.050k in 5.031114s
Comparison:
Enumerable#sort_by (Symbol#to_proc): 52063.4 i/s
Enumerable#sort_by: 50010.9 i/s - 1.04x (± 0.00) slower
Enumerable#sort: 23862.1 i/s - 2.18x (± 0.00) slower
$ ruby -v code/enumerable/sort_by-first-vs-min_by.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Enumerable#min_by 17.196k i/100ms
Enumerable#sort_by...first
8.869k i/100ms
Calculating -------------------------------------
Enumerable#min_by 171.726k (± 1.0%) i/s - 859.800k in 5.007354s
Enumerable#sort_by...first
87.956k (± 0.7%) i/s - 443.450k in 5.041973s
Comparison:
Enumerable#min_by: 171725.9 i/s
Enumerable#sort_by...first: 87955.6 i/s - 1.95x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-dup.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash[] 399.619k i/100ms
Hash#dup 295.331k i/100ms
Calculating -------------------------------------
Hash[] 3.714M (± 0.4%) i/s - 18.782M in 5.056779s
Hash#dup 3.124M (± 1.1%) i/s - 15.653M in 5.010820s
Comparison:
Hash[]: 3714295.5 i/s
Hash#dup: 3124101.3 i/s - 1.19x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-fetch.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#[], symbol 1.438M i/100ms
Hash#fetch, symbol 1.176M i/100ms
Hash#[], string 1.242M i/100ms
Hash#fetch, string 770.121k i/100ms
Calculating -------------------------------------
Hash#[], symbol 14.240M (± 0.2%) i/s - 71.887M in 5.048265s
Hash#fetch, symbol 11.764M (± 0.3%) i/s - 59.958M in 5.096877s
Hash#[], string 12.425M (± 0.4%) i/s - 63.327M in 5.096788s
Hash#fetch, string 7.708M (± 0.2%) i/s - 39.276M in 5.095657s
Comparison:
Hash#[], symbol: 14240113.2 i/s
Hash#[], string: 12425030.5 i/s - 1.15x (± 0.00) slower
Hash#fetch, symbol: 11763817.9 i/s - 1.21x (± 0.00) slower
Hash#fetch, string: 7707814.5 i/s - 1.85x (± 0.00) slower
$ ruby -v code/hash/dig-vs-[]-vs-fetch.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#dig 873.844k i/100ms
Hash#[] 1.006M i/100ms
Hash#[] || 902.959k i/100ms
Hash#[] && 389.133k i/100ms
Hash#fetch 646.795k i/100ms
Hash#fetch fallback 407.519k i/100ms
Calculating -------------------------------------
Hash#dig 8.877M (± 0.7%) i/s - 44.566M in 5.020424s
Hash#[] 10.007M (± 1.1%) i/s - 50.323M in 5.029314s
Hash#[] || 8.963M (± 2.5%) i/s - 45.148M in 5.040227s
Hash#[] && 3.871M (± 2.2%) i/s - 19.457M in 5.028873s
Hash#fetch 6.000M (± 0.9%) i/s - 30.399M in 5.066934s
Hash#fetch fallback 3.972M (± 1.0%) i/s - 19.968M in 5.027962s
Comparison:
Hash#[]: 10007149.9 i/s
Hash#[] ||: 8962915.0 i/s - 1.12x (± 0.00) slower
Hash#dig: 8877329.9 i/s - 1.13x (± 0.00) slower
Hash#fetch: 6000086.0 i/s - 1.67x (± 0.00) slower
Hash#fetch fallback: 3971842.6 i/s - 2.52x (± 0.00) slower
Hash#[] &&: 3870810.7 i/s - 2.59x (± 0.00) slower
$ ruby -v code/hash/fetch-vs-fetch-with-block.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#fetch + const 1.459M i/100ms
Hash#fetch + block 1.450M i/100ms
Hash#fetch + arg 1.091M i/100ms
Calculating -------------------------------------
Hash#fetch + const 14.500M (± 0.5%) i/s - 72.958M in 5.031694s
Hash#fetch + block 14.519M (± 0.5%) i/s - 73.954M in 5.093668s
Hash#fetch + arg 10.897M (± 0.2%) i/s - 54.564M in 5.007044s
Comparison:
Hash#fetch + block: 14519223.3 i/s
Hash#fetch + const: 14499885.5 i/s - same-ish: difference falls within error
Hash#fetch + arg: 10897395.3 i/s - 1.33x (± 0.00) slower
$ ruby -v code/hash/hash-key-sort_by-vs-sort.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
sort_by + to_h 27.336k i/100ms
sort + to_h 11.336k i/100ms
Calculating -------------------------------------
sort_by + to_h 273.702k (± 0.4%) i/s - 1.394M in 5.093716s
sort + to_h 111.497k (± 1.2%) i/s - 566.800k in 5.084311s
Comparison:
sort_by + to_h: 273702.1 i/s
sort + to_h: 111497.2 i/s - 2.45x (± 0.00) slower
$ ruby -v code/hash/keys-each-vs-each_key.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.each 190.697k i/100ms
Hash#each_key 197.245k i/100ms
Calculating -------------------------------------
Hash#keys.each 1.910M (± 0.6%) i/s - 9.726M in 5.092734s
Hash#each_key 1.944M (± 0.2%) i/s - 9.862M in 5.073240s
Comparison:
Hash#each_key: 1943982.1 i/s
Hash#keys.each: 1909772.0 i/s - 1.02x (± 0.00) slower
$ ruby -v code/hash/keys-include-vs-key.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.include? 2.256k i/100ms
Hash#key? 923.439k i/100ms
Calculating -------------------------------------
Hash#keys.include? 22.385k (± 4.8%) i/s - 112.800k in 5.054688s
Hash#key? 9.216M (± 0.5%) i/s - 46.172M in 5.009923s
Comparison:
Hash#key?: 9216322.2 i/s
Hash#keys.include?: 22384.8 i/s - 411.72x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-[]=.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#merge! 4.200k i/100ms
Hash#[]= 10.336k i/100ms
Calculating -------------------------------------
Hash#merge! 41.926k (± 0.6%) i/s - 210.000k in 5.008987s
Hash#[]= 103.257k (± 0.6%) i/s - 516.800k in 5.005182s
Comparison:
Hash#[]=: 103257.0 i/s
Hash#merge!: 41926.0 i/s - 2.46x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-merge-vs-dup-merge-bang.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
{}#merge!(Hash) do end
5.180k i/100ms
Hash#merge({}) 4.155k i/100ms
Hash#dup#merge!({}) 2.709k i/100ms
Calculating -------------------------------------
{}#merge!(Hash) do end
51.298k (± 0.6%) i/s - 259.000k in 5.049115s
Hash#merge({}) 41.057k (± 0.6%) i/s - 207.750k in 5.060294s
Hash#dup#merge!({}) 27.009k (± 0.8%) i/s - 135.450k in 5.015369s
Comparison:
{}#merge!(Hash) do end: 51298.1 i/s
Hash#merge({}): 41056.5 i/s - 1.25x (± 0.00) slower
Hash#dup#merge!({}): 27008.6 i/s - 1.90x (± 0.00) slower
$ ruby -v code/hash/merge-vs-double-splat-operator.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#**other 391.735k i/100ms
Hash#merge 369.847k i/100ms
Calculating -------------------------------------
Hash#**other 3.958M (± 0.9%) i/s - 19.978M in 5.048321s
Hash#merge 3.683M (± 0.7%) i/s - 18.492M in 5.021790s
Comparison:
Hash#**other: 3957751.0 i/s
Hash#merge: 3682584.8 i/s - 1.07x (± 0.00) slower
$ ruby -v code/hash/merge-vs-merge-bang.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#merge 1.702k i/100ms
Hash#merge! 4.071k i/100ms
Calculating -------------------------------------
Hash#merge 16.873k (± 0.7%) i/s - 85.100k in 5.043840s
Hash#merge! 40.958k (± 0.2%) i/s - 207.621k in 5.069174s
Comparison:
Hash#merge!: 40957.8 i/s
Hash#merge: 16872.8 i/s - 2.43x (± 0.00) slower
$ ruby -v code/hash/slice-native-vs-before-native.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#native-slice 426.596k i/100ms
Array#each 234.229k i/100ms
Array#each_w/_object 175.813k i/100ms
Hash#select-include 78.774k i/100ms
Calculating -------------------------------------
Hash#native-slice 4.292M (± 0.7%) i/s - 21.756M in 5.069841s
Array#each 2.327M (± 0.5%) i/s - 11.711M in 5.033947s
Array#each_w/_object 1.737M (± 0.4%) i/s - 8.791M in 5.060977s
Hash#select-include 788.760k (± 0.2%) i/s - 4.017M in 5.093432s
Comparison:
Hash#native-slice : 4291549.2 i/s
Array#each : 2326553.6 i/s - 1.84x (± 0.00) slower
Array#each_w/_object: 1736979.9 i/s - 2.47x (± 0.00) slower
Hash#select-include : 788760.4 i/s - 5.44x (± 0.00) slower
$ ruby -v code/hash/values-include-vs-value.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Hash#values.include? 1.116k i/100ms
Hash#value? 845.000 i/100ms
Calculating -------------------------------------
Hash#values.include? 11.034k (± 4.5%) i/s - 55.800k in 5.069557s
Hash#value? 8.463k (± 0.2%) i/s - 43.095k in 5.092219s
Comparison:
Hash#values.include?: 11033.7 i/s
Hash#value?: 8463.0 i/s - 1.30x (± 0.00) slower
$ ruby -v code/method/call-vs-send-vs-method_missing.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
call 667.539k i/100ms
send 505.437k i/100ms
method_missing 390.039k i/100ms
Calculating -------------------------------------
call 6.688M (± 0.2%) i/s - 34.044M in 5.090274s
send 4.943M (± 0.5%) i/s - 24.766M in 5.010846s
method_missing 3.839M (± 0.3%) i/s - 19.502M in 5.079995s
Comparison:
call: 6688161.0 i/s
send: 4942666.6 i/s - 1.35x (± 0.00) slower
method_missing: 3839010.7 i/s - 1.74x (± 0.00) slower
$ ruby -v code/proc-and-block/block-vs-to_proc.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Block 8.733k i/100ms
Symbol#to_proc 9.306k i/100ms
Calculating -------------------------------------
Block 86.576k (± 0.5%) i/s - 436.650k in 5.043689s
Symbol#to_proc 92.590k (± 0.5%) i/s - 465.300k in 5.025522s
Comparison:
Symbol#to_proc: 92590.0 i/s
Block: 86576.1 i/s - 1.07x (± 0.00) slower
$ ruby -v code/proc-and-block/proc-call-vs-yield.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
block.call 937.543k i/100ms
block + yield 971.320k i/100ms
unused block 1.297M i/100ms
yield 1.168M i/100ms
Calculating -------------------------------------
block.call 9.384M (± 0.3%) i/s - 47.815M in 5.095333s
block + yield 9.719M (± 0.4%) i/s - 49.537M in 5.097246s
unused block 13.033M (± 0.5%) i/s - 66.130M in 5.074365s
yield 11.669M (± 0.4%) i/s - 58.384M in 5.003311s
Comparison:
unused block: 13032523.3 i/s
yield: 11669243.4 i/s - 1.12x (± 0.00) slower
block + yield: 9718618.8 i/s - 1.34x (± 0.00) slower
block.call: 9384111.3 i/s - 1.39x (± 0.00) slower
$ ruby -v code/range/cover-vs-include.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
range#cover? 317.268k i/100ms
range#include? 12.930k i/100ms
range#member? 12.821k i/100ms
plain compare 524.951k i/100ms
Calculating -------------------------------------
range#cover? 3.148M (± 0.4%) i/s - 15.863M in 5.039327s
range#include? 130.573k (± 0.3%) i/s - 659.430k in 5.050338s
range#member? 130.817k (± 0.4%) i/s - 666.692k in 5.096482s
plain compare 5.280M (± 1.4%) i/s - 26.773M in 5.071219s
Comparison:
plain compare: 5280438.7 i/s
range#cover?: 3147977.8 i/s - 1.68x (± 0.00) slower
range#member?: 130816.7 i/s - 40.37x (± 0.00) slower
range#include?: 130573.0 i/s - 40.44x (± 0.00) slower
$ ruby -v code/string/===-vs-=~-vs-match.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#match? 946.906k i/100ms
String#=~ 653.238k i/100ms
Regexp#=== 605.681k i/100ms
String#match 485.092k i/100ms
Calculating -------------------------------------
String#match? 9.400M (± 0.5%) i/s - 47.345M in 5.036621s
String#=~ 6.545M (± 0.7%) i/s - 33.315M in 5.090556s
Regexp#=== 6.040M (± 0.5%) i/s - 30.284M in 5.013973s
String#match 4.872M (± 0.9%) i/s - 24.740M in 5.078811s
Comparison:
String#match?: 9400417.2 i/s
String#=~: 6544863.6 i/s - 1.44x (± 0.00) slower
Regexp#===: 6040113.8 i/s - 1.56x (± 0.00) slower
String#match: 4871549.0 i/s - 1.93x (± 0.00) slower
$ ruby -v code/string/casecmp-vs-downcase-==.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#downcase + == 646.541k i/100ms
String#casecmp 787.615k i/100ms
Calculating -------------------------------------
String#downcase + == 6.325M (± 0.5%) i/s - 31.681M in 5.009084s
String#casecmp 7.909M (± 0.5%) i/s - 40.168M in 5.078940s
Comparison:
String#casecmp: 7909040.3 i/s
String#downcase + ==: 6324759.0 i/s - 1.25x (± 0.00) slower
$ ruby -v code/string/concatenation.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#+ 569.170k i/100ms
String#concat 599.690k i/100ms
String#append 635.205k i/100ms
"foo" "bar" 1.164M i/100ms
"#{'foo'}#{'bar'}" 1.163M i/100ms
Calculating -------------------------------------
String#+ 5.706M (± 0.7%) i/s - 29.028M in 5.087092s
String#concat 5.980M (± 0.4%) i/s - 29.984M in 5.014212s
String#append 6.323M (± 4.1%) i/s - 31.760M in 5.034555s
"foo" "bar" 11.630M (± 0.2%) i/s - 58.195M in 5.003995s
"#{'foo'}#{'bar'}" 11.641M (± 0.2%) i/s - 59.302M in 5.094436s
Comparison:
"#{'foo'}#{'bar'}": 11640527.3 i/s
"foo" "bar": 11629796.1 i/s - same-ish: difference falls within error
String#append: 6323336.3 i/s - 1.84x (± 0.00) slower
String#concat: 5980007.3 i/s - 1.95x (± 0.00) slower
String#+: 5706466.0 i/s - 2.04x (± 0.00) slower
$ ruby -v code/string/dup-vs-unary-plus.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#+@ 1.010M i/100ms
String#dup 572.878k i/100ms
Calculating -------------------------------------
String#+@ 10.098M (± 0.4%) i/s - 50.504M in 5.001466s
String#dup 5.703M (± 0.5%) i/s - 28.644M in 5.022693s
Comparison:
String#+@: 10098109.2 i/s
String#dup: 5703031.8 i/s - 1.77x (± 0.00) slower
$ ruby -v code/string/end-string-checking-match-vs-end_with.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#=~ 175.733k i/100ms
String#match? 386.321k i/100ms
String#end_with? 610.769k i/100ms
Calculating -------------------------------------
String#=~ 1.764M (± 0.3%) i/s - 8.962M in 5.080947s
String#match? 3.880M (± 0.3%) i/s - 19.702M in 5.078598s
String#end_with? 6.100M (± 0.7%) i/s - 30.538M in 5.006152s
Comparison:
String#end_with?: 6100460.9 i/s
String#match?: 3879520.8 i/s - 1.57x (± 0.00) slower
String#=~: 1763931.8 i/s - 3.46x (± 0.00) slower
$ ruby -v code/string/gsub-vs-sub.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#gsub 109.766k i/100ms
String#sub 130.964k i/100ms
String#dup["string"]=
175.720k i/100ms
Calculating -------------------------------------
String#gsub 1.093M (± 6.1%) i/s - 5.488M in 5.051782s
String#sub 1.377M (± 0.5%) i/s - 6.941M in 5.040110s
String#dup["string"]=
1.783M (± 0.5%) i/s - 8.962M in 5.025906s
Comparison:
String#dup["string"]=: 1783145.4 i/s
String#sub: 1377206.4 i/s - 1.29x (± 0.00) slower
String#gsub: 1092908.6 i/s - 1.63x (± 0.00) slower
$ ruby -v code/string/gsub-vs-tr.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#gsub 100.553k i/100ms
String#tr 360.269k i/100ms
Calculating -------------------------------------
String#gsub 1.013M (± 0.5%) i/s - 5.128M in 5.060939s
String#tr 3.589M (± 0.4%) i/s - 18.013M in 5.019628s
Comparison:
String#tr: 3588671.7 i/s
String#gsub: 1013317.6 i/s - 3.54x (± 0.00) slower
$ ruby -v code/string/mutable_vs_immutable_strings.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Without Freeze 1.149M i/100ms
With Freeze 1.612M i/100ms
Calculating -------------------------------------
Without Freeze 11.529M (± 0.5%) i/s - 58.578M in 5.080989s
With Freeze 16.198M (± 1.7%) i/s - 82.219M in 5.077545s
Comparison:
With Freeze: 16197747.9 i/s
Without Freeze: 11529173.7 i/s - 1.40x (± 0.00) slower
$ ruby -v code/string/remove-extra-spaces-or-other-chars.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#gsub/regex+/ 3.339k i/100ms
String#squeeze 154.979k i/100ms
Calculating -------------------------------------
String#gsub/regex+/ 33.453k (± 0.4%) i/s - 170.289k in 5.090526s
String#squeeze 1.550M (± 1.3%) i/s - 7.749M in 5.000487s
Comparison:
String#squeeze: 1549907.5 i/s
String#gsub/regex+/: 33452.8 i/s - 46.33x (± 0.00) slower
$ ruby -v code/string/start-string-checking-match-vs-start_with.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#=~ 254.901k i/100ms
String#match? 644.939k i/100ms
String#start_with? 876.617k i/100ms
Calculating -------------------------------------
String#=~ 2.549M (± 0.4%) i/s - 12.745M in 5.000431s
String#match? 6.456M (± 0.6%) i/s - 32.892M in 5.094968s
String#start_with? 8.737M (± 1.1%) i/s - 43.831M in 5.017230s
Comparison:
String#start_with?: 8737220.1 i/s
String#match?: 6456010.5 i/s - 1.35x (± 0.00) slower
String#=~: 2548834.3 i/s - 3.43x (± 0.00) slower
$ ruby -v code/string/start_with-vs-substring-==.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#start_with? 202.222k i/100ms
String#[0, n] == 83.909k i/100ms
String#[RANGE] == 76.443k i/100ms
String#[0...n] == 45.912k i/100ms
Calculating -------------------------------------
String#start_with? 2.026M (± 1.7%) i/s - 10.313M in 5.092323s
String#[0, n] == 818.717k (± 1.9%) i/s - 4.112M in 5.023725s
String#[RANGE] == 738.036k (± 0.6%) i/s - 3.746M in 5.075419s
String#[0...n] == 455.833k (± 0.9%) i/s - 2.296M in 5.036458s
Comparison:
String#start_with?: 2025851.2 i/s
String#[0, n] ==: 818716.8 i/s - 2.47x (± 0.00) slower
String#[RANGE] ==: 738036.2 i/s - 2.74x (± 0.00) slower
String#[0...n] ==: 455833.2 i/s - 4.44x (± 0.00) slower
$ ruby -v code/string/sub!-vs-gsub!-vs-[]=.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#['string']= 173.002k i/100ms
String#sub!'string' 125.416k i/100ms
String#gsub!'string' 77.414k i/100ms
String#[/regexp/]= 146.091k i/100ms
String#sub!/regexp/ 111.608k i/100ms
String#gsub!/regexp/ 58.617k i/100ms
Calculating -------------------------------------
String#['string']= 1.774M (± 0.5%) i/s - 8.996M in 5.071014s
String#sub!'string' 1.257M (± 0.6%) i/s - 6.396M in 5.088173s
String#gsub!'string' 772.297k (± 0.4%) i/s - 3.871M in 5.012010s
String#[/regexp/]= 1.455M (± 0.3%) i/s - 7.305M in 5.020502s
String#sub!/regexp/ 1.099M (± 0.7%) i/s - 5.580M in 5.075882s
String#gsub!/regexp/ 586.601k (± 1.5%) i/s - 2.989M in 5.097433s
Comparison:
String#['string']=: 1774069.5 i/s
String#[/regexp/]=: 1454953.6 i/s - 1.22x (± 0.00) slower
String#sub!'string': 1257115.7 i/s - 1.41x (± 0.00) slower
String#sub!/regexp/: 1099445.1 i/s - 1.61x (± 0.00) slower
String#gsub!'string': 772296.7 i/s - 2.30x (± 0.00) slower
String#gsub!/regexp/: 586600.8 i/s - 3.02x (± 0.00) slower
$ ruby -v code/string/sub-vs-chomp-vs-delete_suffix.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#sub 147.073k i/100ms
String#chomp 551.866k i/100ms
String#delete_suffix 599.519k i/100ms
Calculating -------------------------------------
String#sub 1.478M (± 0.6%) i/s - 7.501M in 5.074634s
String#chomp 5.548M (± 0.4%) i/s - 28.145M in 5.073149s
String#delete_suffix 6.003M (± 0.6%) i/s - 30.575M in 5.093230s
Comparison:
String#delete_suffix: 6003398.1 i/s
String#chomp: 5547972.3 i/s - 1.08x (± 0.00) slower
String#sub: 1478128.9 i/s - 4.06x (± 0.00) slower
$ ruby -v code/string/sub-vs-delete_prefix.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#delete_prefix 622.976k i/100ms
String#sub 146.151k i/100ms
Calculating -------------------------------------
String#delete_prefix 6.288M (± 0.6%) i/s - 31.772M in 5.053258s
String#sub 1.461M (± 0.5%) i/s - 7.308M in 5.000715s
Comparison:
String#delete_prefix: 6287595.6 i/s
String#sub: 1461342.7 i/s - 4.30x (± 0.00) slower
$ ruby -v code/string/unpack1-vs-unpack[0].rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
String#unpack1 603.794k i/100ms
String#unpack[0] 442.930k i/100ms
Calculating -------------------------------------
String#unpack1 6.004M (± 0.3%) i/s - 30.190M in 5.028654s
String#unpack[0] 4.462M (± 0.4%) i/s - 22.589M in 5.062851s
Comparison:
String#unpack1: 6003600.3 i/s
String#unpack[0]: 4461862.3 i/s - 1.35x (± 0.00) slower
$ ruby -v code/time/iso8601-vs-parse.rb
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Warming up --------------------------------------
Time.iso8601 28.062k i/100ms
Time.parse 9.496k i/100ms
Calculating -------------------------------------
Time.iso8601 280.874k (± 0.3%) i/s - 1.431M in 5.095430s
Time.parse 96.050k (± 0.5%) i/s - 484.296k in 5.042246s
Comparison:
Time.iso8601: 280873.7 i/s
Time.parse: 96049.7 i/s - 2.92x (± 0.00) slower