forked from fastruby/fast-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruby-3.1.2.fastruby
922 lines (800 loc) · 40.2 KB
/
ruby-3.1.2.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.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Function with single Array argument
474.965k i/100ms
Function with splat arguments
10.905k i/100ms
Calculating -------------------------------------
Function with single Array argument
4.995M (± 3.1%) i/s - 25.173M in 5.044812s
Function with splat arguments
149.982k (±10.1%) i/s - 741.540k in 5.019278s
Comparison:
Function with single Array argument: 4994739.7 i/s
Function with splat arguments: 149981.6 i/s - 33.30x (± 0.00) slower
$ ruby -v code/general/assignment.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Parallel Assignment 851.312k i/100ms
Sequential Assignment
880.534k i/100ms
Calculating -------------------------------------
Parallel Assignment 8.714M (± 2.6%) i/s - 44.268M in 5.083408s
Sequential Assignment
8.806M (± 3.6%) i/s - 44.027M in 5.006291s
Comparison:
Sequential Assignment: 8805969.9 i/s
Parallel Assignment: 8714354.1 i/s - same-ish: difference falls within error
$ ruby -v code/general/attr-accessor-vs-getter-and-setter.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
getter_and_setter 310.073k i/100ms
attr_accessor 316.454k i/100ms
Calculating -------------------------------------
getter_and_setter 3.017M (± 3.4%) i/s - 15.194M in 5.041202s
attr_accessor 3.359M (± 4.1%) i/s - 16.772M in 5.001595s
Comparison:
attr_accessor: 3359088.9 i/s
getter_and_setter: 3017241.9 i/s - 1.11x (± 0.00) slower
$ ruby -v code/general/begin-rescue-vs-respond-to.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
begin...rescue 60.313k i/100ms
respond_to? 498.999k i/100ms
Calculating -------------------------------------
begin...rescue 614.122k (± 6.1%) i/s - 3.076M in 5.029944s
respond_to? 5.173M (± 3.4%) i/s - 25.948M in 5.021852s
Comparison:
respond_to?: 5173183.5 i/s
begin...rescue: 614122.2 i/s - 8.42x (± 0.00) slower
$ ruby -v code/general/block-apply-method.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
normal 201.183k i/100ms
&method 76.890k i/100ms
Calculating -------------------------------------
normal 2.050M (± 2.9%) i/s - 10.260M in 5.010087s
&method 763.967k (± 2.9%) i/s - 3.844M in 5.036429s
Comparison:
normal: 2049696.4 i/s
&method: 763967.2 i/s - 2.68x (± 0.00) slower
$ ruby -v code/general/define_method-vs-module-eval.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
module_eval with string
159.000 i/100ms
define_method 202.000 i/100ms
Calculating -------------------------------------
module_eval with string
1.471k (±21.4%) i/s - 6.996k in 5.296106s
define_method 2.173k (±19.8%) i/s - 9.898k in 5.082744s
Comparison:
define_method: 2173.1 i/s
module_eval with string: 1471.0 i/s - same-ish: difference falls within error
$ ruby -v code/general/format-vs-round-and-to-s.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Float#round 125.400k i/100ms
Kernel#format 131.007k i/100ms
String#% 120.913k i/100ms
Calculating -------------------------------------
Float#round 1.289M (± 4.2%) i/s - 6.521M in 5.068358s
Kernel#format 1.362M (± 3.7%) i/s - 6.812M in 5.010286s
String#% 1.214M (± 3.7%) i/s - 6.167M in 5.085645s
Comparison:
Kernel#format: 1361512.5 i/s
Float#round: 1289040.5 i/s - same-ish: difference falls within error
String#%: 1214240.6 i/s - 1.12x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct-on-access.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash 602.337k i/100ms
OpenStruct 314.440k i/100ms
Calculating -------------------------------------
Hash 5.702M (± 4.5%) i/s - 28.912M in 5.080984s
OpenStruct 3.141M (± 3.9%) i/s - 15.722M in 5.013635s
Comparison:
Hash: 5702083.5 i/s
OpenStruct: 3140923.4 i/s - 1.82x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash 735.998k i/100ms
OpenStruct 6.187k i/100ms
Calculating -------------------------------------
Hash 7.279M (± 4.6%) i/s - 36.800M in 5.068224s
OpenStruct 57.047k (± 4.9%) i/s - 284.602k in 5.001241s
Comparison:
Hash: 7278764.3 i/s
OpenStruct: 57046.6 i/s - 127.59x (± 0.00) slower
$ ruby -v code/general/inheritance-check.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
less than or equal 413.576k i/100ms
ancestors.include? 78.002k i/100ms
Calculating -------------------------------------
less than or equal 4.165M (± 3.0%) i/s - 21.092M in 5.069053s
ancestors.include? 781.094k (± 3.4%) i/s - 3.978M in 5.099009s
Comparison:
less than or equal: 4164789.0 i/s
ancestors.include?: 781093.8 i/s - 5.33x (± 0.00) slower
$ ruby -v code/general/loop-vs-while-true.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
While Loop 1.000 i/100ms
Kernel loop 1.000 i/100ms
Calculating -------------------------------------
While Loop 0.515 (± 0.0%) i/s - 3.000 in 5.829929s
Kernel loop 0.160 (± 0.0%) i/s - 1.000 in 6.235715s
Comparison:
While Loop: 0.5 i/s
Kernel loop: 0.2 i/s - 3.21x (± 0.00) slower
$ ruby -v code/general/raise-vs-e2mmap.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
$ ruby -v code/array/array-first-vs-index.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#[0] 1.123M i/100ms
Array#first 940.541k i/100ms
Calculating -------------------------------------
Array#[0] 10.947M (± 2.9%) i/s - 55.048M in 5.033217s
Array#first 9.491M (± 2.6%) i/s - 47.968M in 5.057402s
Comparison:
Array#[0]: 10947054.4 i/s
Array#first: 9491212.7 i/s - 1.15x (± 0.00) slower
$ ruby -v code/array/array-last-vs-index.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#[-1] 1.042M i/100ms
Array#last 915.865k i/100ms
Calculating -------------------------------------
Array#[-1] 10.857M (± 4.1%) i/s - 54.209M in 5.001909s
Array#last 9.704M (± 2.6%) i/s - 48.541M in 5.005396s
Comparison:
Array#[-1]: 10857301.4 i/s
Array#last: 9704306.7 i/s - 1.12x (± 0.00) slower
$ ruby -v code/array/bsearch-vs-find.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
find 1.000 i/100ms
bsearch 64.056k i/100ms
Calculating -------------------------------------
find 0.165 (± 0.0%) i/s - 1.000 in 6.062270s
bsearch 610.381k (± 5.4%) i/s - 3.075M in 5.052195s
Comparison:
bsearch: 610381.4 i/s
find: 0.2 i/s - 3700296.90x (± 0.00) slower
$ ruby -v code/array/insert-vs-unshift.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#unshift 10.000 i/100ms
Array#insert 1.000 i/100ms
Calculating -------------------------------------
Array#unshift 104.568 (± 3.8%) i/s - 530.000 in 5.076811s
Array#insert 0.451 (± 0.0%) i/s - 3.000 in 6.649739s
Comparison:
Array#unshift: 104.6 i/s
Array#insert: 0.5 i/s - 231.71x (± 0.00) slower
$ ruby -v code/array/length-vs-size-vs-count.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#length 1.623M i/100ms
Array#size 1.612M i/100ms
Array#count 1.177M i/100ms
Calculating -------------------------------------
Array#length 16.272M (± 2.8%) i/s - 82.766M in 5.090316s
Array#size 16.208M (± 4.3%) i/s - 82.235M in 5.084140s
Array#count 11.573M (± 3.7%) i/s - 58.831M in 5.090318s
Comparison:
Array#length: 16272273.9 i/s
Array#size: 16208488.9 i/s - same-ish: difference falls within error
Array#count: 11573130.2 i/s - 1.41x (± 0.00) slower
$ ruby -v code/array/shuffle-first-vs-sample.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#shuffle.first 31.961k i/100ms
Array#sample 749.937k i/100ms
Calculating -------------------------------------
Array#shuffle.first 313.211k (± 3.9%) i/s - 1.566M in 5.007567s
Array#sample 7.438M (± 3.1%) i/s - 37.497M in 5.046525s
Comparison:
Array#sample: 7437664.8 i/s
Array#shuffle.first: 313211.0 i/s - 23.75x (± 0.00) slower
$ ruby -v code/date/iso8601-vs-parse.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Date.iso8601 44.988k i/100ms
Date.parse 21.261k i/100ms
Calculating -------------------------------------
Date.iso8601 446.188k (± 2.3%) i/s - 2.249M in 5.043998s
Date.parse 206.260k (± 3.1%) i/s - 1.042M in 5.055998s
Comparison:
Date.iso8601: 446188.4 i/s
Date.parse: 206259.5 i/s - 2.16x (± 0.00) slower
$ ruby -v code/enumerable/each-push-vs-map.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#each + push 11.676k i/100ms
Array#map 17.120k i/100ms
Calculating -------------------------------------
Array#each + push 109.449k (± 4.9%) i/s - 548.772k in 5.025382s
Array#map 156.623k (± 2.9%) i/s - 787.520k in 5.032240s
Comparison:
Array#map: 156623.3 i/s
Array#each + push: 109449.0 i/s - 1.43x (± 0.00) slower
$ ruby -v code/enumerable/each-vs-for-loop.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
For loop 17.614k i/100ms
#each 19.249k i/100ms
Calculating -------------------------------------
For loop 182.564k (± 3.5%) i/s - 915.928k in 5.023376s
#each 198.382k (± 4.0%) i/s - 1.001M in 5.053983s
Comparison:
#each: 198381.8 i/s
For loop: 182563.9 i/s - 1.09x (± 0.00) slower
$ ruby -v code/enumerable/each_with_index-vs-while-loop.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
While Loop 25.974k i/100ms
each_with_index 12.027k i/100ms
Calculating -------------------------------------
While Loop 255.938k (± 3.9%) i/s - 1.299M in 5.082468s
each_with_index 124.625k (± 3.8%) i/s - 625.404k in 5.025475s
Comparison:
While Loop: 255937.9 i/s
each_with_index: 124625.2 i/s - 2.05x (± 0.00) slower
$ ruby -v code/enumerable/inject-symbol-vs-block.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
inject symbol 64.107k i/100ms
inject to_proc 1.350k i/100ms
inject block 1.344k i/100ms
Calculating -------------------------------------
inject symbol 675.524k (± 2.9%) i/s - 3.398M in 5.034022s
inject to_proc 13.253k (± 4.3%) i/s - 66.150k in 5.000975s
inject block 13.139k (± 2.9%) i/s - 65.856k in 5.016717s
Comparison:
inject symbol: 675523.6 i/s
inject to_proc: 13253.5 i/s - 50.97x (± 0.00) slower
inject block: 13138.6 i/s - 51.42x (± 0.00) slower
$ ruby -v code/enumerable/map-flatten-vs-flat_map.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#map.flatten(1) 4.487k i/100ms
Array#map.flatten 2.461k i/100ms
Array#flat_map 6.130k i/100ms
Calculating -------------------------------------
Array#map.flatten(1) 47.657k (± 4.6%) i/s - 242.298k in 5.095850s
Array#map.flatten 24.335k (± 4.5%) i/s - 123.050k in 5.066949s
Array#flat_map 59.193k (± 3.1%) i/s - 300.370k in 5.079238s
Comparison:
Array#flat_map: 59193.0 i/s
Array#map.flatten(1): 47656.7 i/s - 1.24x (± 0.00) slower
Array#map.flatten: 24334.9 i/s - 2.43x (± 0.00) slower
$ ruby -v code/enumerable/reverse-each-vs-reverse_each.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Array#reverse.each 21.444k i/100ms
Array#reverse_each 22.499k i/100ms
Calculating -------------------------------------
Array#reverse.each 211.079k (± 3.9%) i/s - 1.072M in 5.088219s
Array#reverse_each 222.625k (± 3.6%) i/s - 1.125M in 5.059710s
Comparison:
Array#reverse_each: 222625.1 i/s
Array#reverse.each: 211079.3 i/s - same-ish: difference falls within error
$ ruby -v code/enumerable/select-first-vs-detect.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Enumerable#select.first
13.486k i/100ms
Enumerable#detect 51.347k i/100ms
Calculating -------------------------------------
Enumerable#select.first
131.548k (± 4.5%) i/s - 2.630M in 20.034269s
Enumerable#detect 531.348k (± 3.8%) i/s - 10.629M in 20.033291s
Comparison:
Enumerable#detect: 531348.0 i/s
Enumerable#select.first: 131547.9 i/s - 4.04x (± 0.00) slower
$ ruby -v code/enumerable/select-last-vs-reverse-detect.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Enumerable#reverse.detect
157.943k i/100ms
Enumerable#select.last
11.118k i/100ms
Calculating -------------------------------------
Enumerable#reverse.detect
1.559M (± 2.9%) i/s - 7.897M in 5.070262s
Enumerable#select.last
113.513k (± 4.0%) i/s - 567.018k in 5.003438s
Comparison:
Enumerable#reverse.detect: 1558856.5 i/s
Enumerable#select.last: 113513.1 i/s - 13.73x (± 0.00) slower
$ ruby -v code/enumerable/sort-vs-sort_by.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Enumerable#sort_by (Symbol#to_proc)
2.914k i/100ms
Enumerable#sort_by 2.964k i/100ms
Enumerable#sort 1.525k i/100ms
Calculating -------------------------------------
Enumerable#sort_by (Symbol#to_proc)
29.036k (± 2.5%) i/s - 145.700k in 5.021301s
Enumerable#sort_by 27.857k (± 3.1%) i/s - 139.308k in 5.006005s
Enumerable#sort 14.964k (± 4.0%) i/s - 76.250k in 5.104389s
Comparison:
Enumerable#sort_by (Symbol#to_proc): 29035.6 i/s
Enumerable#sort_by: 27856.5 i/s - same-ish: difference falls within error
Enumerable#sort: 14964.0 i/s - 1.94x (± 0.00) slower
$ ruby -v code/enumerable/sort_by-first-vs-min_by.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Enumerable#min_by 9.880k i/100ms
Enumerable#sort_by...first
4.882k i/100ms
Calculating -------------------------------------
Enumerable#min_by 108.062k (± 6.0%) i/s - 543.400k in 5.048207s
Enumerable#sort_by...first
53.250k (± 4.2%) i/s - 268.510k in 5.051564s
Comparison:
Enumerable#min_by: 108061.9 i/s
Enumerable#sort_by...first: 53249.7 i/s - 2.03x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-dup.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash[] 227.510k i/100ms
Hash#dup 165.831k i/100ms
Calculating -------------------------------------
Hash[] 2.092M (± 3.7%) i/s - 10.465M in 5.010014s
Hash#dup 1.796M (± 4.2%) i/s - 9.121M in 5.087462s
Comparison:
Hash[]: 2091853.6 i/s
Hash#dup: 1795842.2 i/s - 1.16x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-fetch.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#[], symbol 961.205k i/100ms
Hash#fetch, symbol 808.333k i/100ms
Hash#[], string 862.409k i/100ms
Hash#fetch, string 498.233k i/100ms
Calculating -------------------------------------
Hash#[], symbol 10.170M (± 4.8%) i/s - 50.944M in 5.021686s
Hash#fetch, symbol 8.122M (± 3.1%) i/s - 41.225M in 5.080253s
Hash#[], string 8.958M (± 3.6%) i/s - 44.845M in 5.012359s
Hash#fetch, string 4.996M (± 3.5%) i/s - 25.410M in 5.092896s
Comparison:
Hash#[], symbol: 10170323.9 i/s
Hash#[], string: 8958436.1 i/s - 1.14x (± 0.00) slower
Hash#fetch, symbol: 8122401.3 i/s - 1.25x (± 0.00) slower
Hash#fetch, string: 4995613.7 i/s - 2.04x (± 0.00) slower
$ ruby -v code/hash/dig-vs-[]-vs-fetch.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#dig 625.764k i/100ms
Hash#[] 764.063k i/100ms
Hash#[] || 706.284k i/100ms
Hash#[] && 303.994k i/100ms
Hash#fetch 436.345k i/100ms
Hash#fetch fallback 243.173k i/100ms
Calculating -------------------------------------
Hash#dig 6.192M (± 3.5%) i/s - 31.288M in 5.059016s
Hash#[] 7.508M (± 4.0%) i/s - 38.203M in 5.096844s
Hash#[] || 6.483M (± 3.1%) i/s - 32.489M in 5.016626s
Hash#[] && 2.859M (± 4.0%) i/s - 14.288M in 5.004306s
Hash#fetch 4.094M (± 3.3%) i/s - 20.508M in 5.014486s
Hash#fetch fallback 2.434M (± 3.6%) i/s - 12.159M in 5.003069s
Comparison:
Hash#[]: 7507762.4 i/s
Hash#[] ||: 6482708.6 i/s - 1.16x (± 0.00) slower
Hash#dig: 6192411.2 i/s - 1.21x (± 0.00) slower
Hash#fetch: 4094206.0 i/s - 1.83x (± 0.00) slower
Hash#[] &&: 2859448.4 i/s - 2.63x (± 0.00) slower
Hash#fetch fallback: 2433506.0 i/s - 3.09x (± 0.00) slower
$ ruby -v code/hash/fetch-vs-fetch-with-block.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#fetch + const 1.040M i/100ms
Hash#fetch + block 1.048M i/100ms
Hash#fetch + arg 704.179k i/100ms
Calculating -------------------------------------
Hash#fetch + const 10.677M (± 2.6%) i/s - 54.081M in 5.068743s
Hash#fetch + block 10.284M (± 3.2%) i/s - 51.376M in 5.000612s
Hash#fetch + arg 6.813M (± 3.1%) i/s - 34.505M in 5.069449s
Comparison:
Hash#fetch + const: 10676949.9 i/s
Hash#fetch + block: 10284422.7 i/s - same-ish: difference falls within error
Hash#fetch + arg: 6813305.2 i/s - 1.57x (± 0.00) slower
$ ruby -v code/hash/hash-key-sort_by-vs-sort.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
sort_by + to_h 16.366k i/100ms
sort + to_h 7.596k i/100ms
Calculating -------------------------------------
sort_by + to_h 167.367k (± 3.3%) i/s - 851.032k in 5.090367s
sort + to_h 75.169k (± 3.8%) i/s - 379.800k in 5.060305s
Comparison:
sort_by + to_h: 167367.5 i/s
sort + to_h: 75169.5 i/s - 2.23x (± 0.00) slower
$ ruby -v code/hash/keys-each-vs-each_key.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.each 114.904k i/100ms
Hash#each_key 117.249k i/100ms
Calculating -------------------------------------
Hash#keys.each 1.181M (± 3.9%) i/s - 5.975M in 5.069101s
Hash#each_key 1.231M (± 3.7%) i/s - 6.214M in 5.056226s
Comparison:
Hash#each_key: 1230767.3 i/s
Hash#keys.each: 1180534.3 i/s - same-ish: difference falls within error
$ ruby -v code/hash/keys-include-vs-key.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.include? 780.000 i/100ms
Hash#key? 714.134k i/100ms
Calculating -------------------------------------
Hash#keys.include? 7.420k (± 4.9%) i/s - 37.440k in 5.058132s
Hash#key? 7.116M (± 3.5%) i/s - 35.707M in 5.024406s
Comparison:
Hash#key?: 7115519.6 i/s
Hash#keys.include?: 7420.3 i/s - 958.93x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-[]=.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#merge! 2.500k i/100ms
Hash#[]= 6.147k i/100ms
Calculating -------------------------------------
Hash#merge! 25.315k (± 4.4%) i/s - 127.500k in 5.046454s
Hash#[]= 59.081k (± 5.3%) i/s - 295.056k in 5.007796s
Comparison:
Hash#[]=: 59081.4 i/s
Hash#merge!: 25315.0 i/s - 2.33x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-merge-vs-dup-merge-bang.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
{}#merge!(Hash) do end
3.302k i/100ms
Hash#merge({}) 2.600k i/100ms
Hash#dup#merge!({}) 1.808k i/100ms
Calculating -------------------------------------
{}#merge!(Hash) do end
32.976k (± 2.8%) i/s - 165.100k in 5.010533s
Hash#merge({}) 25.482k (± 3.3%) i/s - 127.400k in 5.004892s
Hash#dup#merge!({}) 19.257k (± 3.7%) i/s - 97.632k in 5.077080s
Comparison:
{}#merge!(Hash) do end: 32975.9 i/s
Hash#merge({}): 25481.8 i/s - 1.29x (± 0.00) slower
Hash#dup#merge!({}): 19256.9 i/s - 1.71x (± 0.00) slower
$ ruby -v code/hash/merge-vs-double-splat-operator.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#**other 251.578k i/100ms
Hash#merge 213.521k i/100ms
Calculating -------------------------------------
Hash#**other 2.444M (± 4.4%) i/s - 12.327M in 5.053416s
Hash#merge 2.117M (± 5.3%) i/s - 10.676M in 5.056446s
Comparison:
Hash#**other: 2444287.6 i/s
Hash#merge: 2117431.0 i/s - 1.15x (± 0.00) slower
$ ruby -v code/hash/merge-vs-merge-bang.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#merge 842.000 i/100ms
Hash#merge! 2.473k i/100ms
Calculating -------------------------------------
Hash#merge 8.322k (± 4.9%) i/s - 42.100k in 5.070845s
Hash#merge! 24.319k (± 2.7%) i/s - 123.650k in 5.088316s
Comparison:
Hash#merge!: 24319.2 i/s
Hash#merge: 8322.0 i/s - 2.92x (± 0.00) slower
$ ruby -v code/hash/slice-native-vs-before-native.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#native-slice 270.518k i/100ms
Array#each 139.119k i/100ms
Array#each_w/_object 106.409k i/100ms
Hash#select-include 44.618k i/100ms
Calculating -------------------------------------
Hash#native-slice 2.605M (± 3.6%) i/s - 13.255M in 5.095464s
Array#each 1.421M (± 4.0%) i/s - 7.095M in 5.000789s
Array#each_w/_object 1.091M (± 5.9%) i/s - 5.533M in 5.087964s
Hash#select-include 454.776k (± 3.2%) i/s - 2.320M in 5.107005s
Comparison:
Hash#native-slice : 2604872.0 i/s
Array#each : 1421063.9 i/s - 1.83x (± 0.00) slower
Array#each_w/_object: 1091458.9 i/s - 2.39x (± 0.00) slower
Hash#select-include : 454776.1 i/s - 5.73x (± 0.00) slower
$ ruby -v code/hash/values-include-vs-value.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Hash#values.include? 1.078k i/100ms
Hash#value? 1.216k i/100ms
Calculating -------------------------------------
Hash#values.include? 10.856k (± 6.1%) i/s - 54.978k in 5.086228s
Hash#value? 12.039k (± 3.1%) i/s - 60.800k in 5.055373s
Comparison:
Hash#value?: 12038.7 i/s
Hash#values.include?: 10856.4 i/s - 1.11x (± 0.00) slower
$ ruby -v code/method/call-vs-send-vs-method_missing.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
call 452.226k i/100ms
send 330.838k i/100ms
method_missing 247.029k i/100ms
Calculating -------------------------------------
call 4.360M (± 4.0%) i/s - 22.159M in 5.090608s
send 3.362M (± 3.7%) i/s - 16.873M in 5.025031s
method_missing 2.562M (± 3.1%) i/s - 12.846M in 5.017817s
Comparison:
call: 4360223.2 i/s
send: 3362373.3 i/s - 1.30x (± 0.00) slower
method_missing: 2562494.6 i/s - 1.70x (± 0.00) slower
$ ruby -v code/proc-and-block/block-vs-to_proc.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Block 4.692k i/100ms
Symbol#to_proc 5.398k i/100ms
Calculating -------------------------------------
Block 46.426k (± 3.0%) i/s - 234.600k in 5.057924s
Symbol#to_proc 51.271k (± 3.7%) i/s - 259.104k in 5.061112s
Comparison:
Symbol#to_proc: 51271.2 i/s
Block: 46425.9 i/s - 1.10x (± 0.00) slower
$ ruby -v code/proc-and-block/proc-call-vs-yield.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
block.call 643.675k i/100ms
block + yield 659.348k i/100ms
unused block 917.232k i/100ms
yield 866.990k i/100ms
Calculating -------------------------------------
block.call 6.499M (± 3.9%) i/s - 32.827M in 5.059658s
block + yield 6.811M (± 4.6%) i/s - 34.286M in 5.045280s
unused block 8.815M (± 3.4%) i/s - 44.944M in 5.104608s
yield 8.931M (± 4.1%) i/s - 45.083M in 5.056876s
Comparison:
yield: 8930577.1 i/s
unused block: 8815232.6 i/s - same-ish: difference falls within error
block + yield: 6810642.7 i/s - 1.31x (± 0.00) slower
block.call: 6499065.8 i/s - 1.37x (± 0.00) slower
$ ruby -v code/range/cover-vs-include.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
range#cover? 214.018k i/100ms
range#include? 8.576k i/100ms
range#member? 8.499k i/100ms
plain compare 311.911k i/100ms
Calculating -------------------------------------
range#cover? 2.110M (± 3.9%) i/s - 10.701M in 5.079888s
range#include? 86.792k (± 3.5%) i/s - 437.376k in 5.045576s
range#member? 86.082k (± 3.1%) i/s - 433.449k in 5.040306s
plain compare 3.206M (± 3.6%) i/s - 16.219M in 5.066106s
Comparison:
plain compare: 3205685.7 i/s
range#cover?: 2109893.8 i/s - 1.52x (± 0.00) slower
range#include?: 86792.5 i/s - 36.94x (± 0.00) slower
range#member?: 86082.3 i/s - 37.24x (± 0.00) slower
$ ruby -v code/string/===-vs-=~-vs-match.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#match? 645.515k i/100ms
String#=~ 393.954k i/100ms
Regexp#=== 356.376k i/100ms
String#match 297.242k i/100ms
Calculating -------------------------------------
String#match? 6.337M (± 4.2%) i/s - 31.630M in 5.000137s
String#=~ 3.917M (± 3.8%) i/s - 19.698M in 5.036602s
Regexp#=== 3.599M (± 3.9%) i/s - 18.175M in 5.057721s
String#match 3.101M (± 3.4%) i/s - 15.754M in 5.086532s
Comparison:
String#match?: 6337298.7 i/s
String#=~: 3916540.6 i/s - 1.62x (± 0.00) slower
Regexp#===: 3599113.8 i/s - 1.76x (± 0.00) slower
String#match: 3100837.0 i/s - 2.04x (± 0.00) slower
$ ruby -v code/string/casecmp-vs-downcase-==.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#downcase + == 405.032k i/100ms
String#casecmp 547.680k i/100ms
Calculating -------------------------------------
String#downcase + == 4.145M (± 4.3%) i/s - 21.062M in 5.090780s
String#casecmp 5.458M (± 3.4%) i/s - 27.384M in 5.023182s
Comparison:
String#casecmp: 5458073.1 i/s
String#downcase + ==: 4145391.3 i/s - 1.32x (± 0.00) slower
$ ruby -v code/string/concatenation.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#+ 375.538k i/100ms
String#concat 396.416k i/100ms
String#append 436.331k i/100ms
"foo" "bar" 844.915k i/100ms
"#{'foo'}#{'bar'}" 828.472k i/100ms
Calculating -------------------------------------
String#+ 3.702M (± 3.6%) i/s - 18.777M in 5.078423s
String#concat 4.046M (± 3.1%) i/s - 20.217M in 5.001840s
String#append 4.371M (± 4.8%) i/s - 21.817M in 5.004302s
"foo" "bar" 8.613M (± 4.1%) i/s - 43.091M in 5.011142s
"#{'foo'}#{'bar'}" 8.414M (± 3.1%) i/s - 42.252M in 5.026579s
Comparison:
"foo" "bar": 8613472.9 i/s
"#{'foo'}#{'bar'}": 8413681.4 i/s - same-ish: difference falls within error
String#append: 4370724.1 i/s - 1.97x (± 0.00) slower
String#concat: 4045782.1 i/s - 2.13x (± 0.00) slower
String#+: 3702120.1 i/s - 2.33x (± 0.00) slower
$ ruby -v code/string/dup-vs-unary-plus.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#+@ 691.255k i/100ms
String#dup 338.358k i/100ms
Calculating -------------------------------------
String#+@ 6.742M (± 2.5%) i/s - 33.871M in 5.027412s
String#dup 3.253M (± 3.8%) i/s - 16.580M in 5.103561s
Comparison:
String#+@: 6741680.9 i/s
String#dup: 3253428.7 i/s - 2.07x (± 0.00) slower
$ ruby -v code/string/end-string-checking-match-vs-end_with.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#=~ 120.939k i/100ms
String#match? 284.300k i/100ms
String#end_with? 409.148k i/100ms
Calculating -------------------------------------
String#=~ 1.246M (± 2.6%) i/s - 6.289M in 5.051491s
String#match? 2.971M (± 2.6%) i/s - 15.068M in 5.074352s
String#end_with? 4.178M (± 2.7%) i/s - 21.276M in 5.096123s
Comparison:
String#end_with?: 4178022.7 i/s
String#match?: 2971381.0 i/s - 1.41x (± 0.00) slower
String#=~: 1245813.7 i/s - 3.35x (± 0.00) slower
$ ruby -v code/string/gsub-vs-sub.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#gsub 73.649k i/100ms
String#sub 89.596k i/100ms
String#dup["string"]=
122.361k i/100ms
Calculating -------------------------------------
String#gsub 726.914k (± 5.9%) i/s - 3.682M in 5.084741s
String#sub 910.015k (± 2.6%) i/s - 4.569M in 5.024666s
String#dup["string"]=
1.209M (± 2.4%) i/s - 6.118M in 5.064279s
Comparison:
String#dup["string"]=: 1208797.5 i/s
String#sub: 910015.4 i/s - 1.33x (± 0.00) slower
String#gsub: 726914.1 i/s - 1.66x (± 0.00) slower
$ ruby -v code/string/gsub-vs-tr.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#gsub 63.136k i/100ms
String#tr 224.331k i/100ms
Calculating -------------------------------------
String#gsub 629.523k (± 5.4%) i/s - 3.157M in 5.029385s
String#tr 2.354M (± 4.0%) i/s - 11.890M in 5.059447s
Comparison:
String#tr: 2353801.9 i/s
String#gsub: 629523.1 i/s - 3.74x (± 0.00) slower
$ ruby -v code/string/mutable_vs_immutable_strings.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Without Freeze 766.227k i/100ms
With Freeze 1.272M i/100ms
Calculating -------------------------------------
Without Freeze 8.080M (± 5.2%) i/s - 40.610M in 5.040198s
With Freeze 12.325M (± 4.3%) i/s - 62.323M in 5.066131s
Comparison:
With Freeze: 12325322.9 i/s
Without Freeze: 8079723.6 i/s - 1.53x (± 0.00) slower
$ ruby -v code/string/remove-extra-spaces-or-other-chars.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#gsub/regex+/ 2.182k i/100ms
String#squeeze 113.038k i/100ms
Calculating -------------------------------------
String#gsub/regex+/ 21.844k (± 3.8%) i/s - 109.100k in 5.001695s
String#squeeze 1.063M (± 3.1%) i/s - 5.313M in 5.001758s
Comparison:
String#squeeze: 1063237.8 i/s
String#gsub/regex+/: 21844.2 i/s - 48.67x (± 0.00) slower
$ ruby -v code/string/start-string-checking-match-vs-start_with.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#=~ 178.020k i/100ms
String#match? 515.593k i/100ms
String#start_with? 552.189k i/100ms
Calculating -------------------------------------
String#=~ 1.767M (± 4.0%) i/s - 8.901M in 5.044869s
String#match? 4.778M (± 3.0%) i/s - 24.233M in 5.076424s
String#start_with? 5.718M (± 3.8%) i/s - 28.714M in 5.029125s
Comparison:
String#start_with?: 5717918.5 i/s
String#match?: 4778021.4 i/s - 1.20x (± 0.00) slower
String#=~: 1767252.9 i/s - 3.24x (± 0.00) slower
$ ruby -v code/string/start_with-vs-substring-==.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#start_with? 148.453k i/100ms
String#[0, n] == 51.361k i/100ms
String#[RANGE] == 46.250k i/100ms
String#[0...n] == 28.863k i/100ms
Calculating -------------------------------------
String#start_with? 1.503M (± 4.2%) i/s - 7.571M in 5.045333s
String#[0, n] == 511.138k (± 3.5%) i/s - 2.568M in 5.029986s
String#[RANGE] == 458.908k (± 2.8%) i/s - 2.312M in 5.043288s
String#[0...n] == 291.879k (± 3.1%) i/s - 1.472M in 5.048218s
Comparison:
String#start_with?: 1503319.3 i/s
String#[0, n] ==: 511138.0 i/s - 2.94x (± 0.00) slower
String#[RANGE] ==: 458908.2 i/s - 3.28x (± 0.00) slower
String#[0...n] ==: 291879.1 i/s - 5.15x (± 0.00) slower
$ ruby -v code/string/sub!-vs-gsub!-vs-[]=.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#['string']= 117.277k i/100ms
String#sub!'string' 81.952k i/100ms
String#gsub!'string' 50.712k i/100ms
String#[/regexp/]= 107.234k i/100ms
String#sub!/regexp/ 81.043k i/100ms
String#gsub!/regexp/ 41.048k i/100ms
Calculating -------------------------------------
String#['string']= 1.139M (± 3.2%) i/s - 5.747M in 5.049466s
String#sub!'string' 817.322k (± 3.5%) i/s - 4.098M in 5.020049s
String#gsub!'string' 511.996k (± 3.4%) i/s - 2.586M in 5.057611s
String#[/regexp/]= 1.049M (± 4.7%) i/s - 5.254M in 5.022889s
String#sub!/regexp/ 812.592k (± 2.8%) i/s - 4.133M in 5.090396s
String#gsub!/regexp/ 409.066k (± 4.1%) i/s - 2.052M in 5.025933s
Comparison:
String#['string']=: 1139280.7 i/s
String#[/regexp/]=: 1048605.8 i/s - 1.09x (± 0.00) slower
String#sub!'string': 817322.0 i/s - 1.39x (± 0.00) slower
String#sub!/regexp/: 812591.8 i/s - 1.40x (± 0.00) slower
String#gsub!'string': 511996.4 i/s - 2.23x (± 0.00) slower
String#gsub!/regexp/: 409066.5 i/s - 2.79x (± 0.00) slower
$ ruby -v code/string/sub-vs-chomp-vs-delete_suffix.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#sub 105.633k i/100ms
String#chomp 350.924k i/100ms
String#delete_suffix 382.656k i/100ms
Calculating -------------------------------------
String#sub 1.021M (± 4.4%) i/s - 5.176M in 5.082246s
String#chomp 3.479M (± 3.6%) i/s - 17.546M in 5.050045s
String#delete_suffix 3.779M (± 3.3%) i/s - 19.133M in 5.068287s
Comparison:
String#delete_suffix: 3779064.9 i/s
String#chomp: 3478963.8 i/s - 1.09x (± 0.00) slower
String#sub: 1020556.6 i/s - 3.70x (± 0.00) slower
$ ruby -v code/string/sub-vs-delete_prefix.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#delete_prefix 394.508k i/100ms
String#sub 100.281k i/100ms
Calculating -------------------------------------
String#delete_prefix 3.925M (± 2.6%) i/s - 19.725M in 5.028551s
String#sub 1.001M (± 3.8%) i/s - 5.014M in 5.018776s
Comparison:
String#delete_prefix: 3925398.9 i/s
String#sub: 1000579.1 i/s - 3.92x (± 0.00) slower
$ ruby -v code/string/unpack1-vs-unpack[0].rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
String#unpack1 385.106k i/100ms
String#unpack[0] 287.033k i/100ms
Calculating -------------------------------------
String#unpack1 3.814M (± 3.6%) i/s - 19.255M in 5.055493s
String#unpack[0] 2.841M (± 3.8%) i/s - 14.352M in 5.059673s
Comparison:
String#unpack1: 3813964.1 i/s
String#unpack[0]: 2840747.5 i/s - 1.34x (± 0.00) slower
$ ruby -v code/time/iso8601-vs-parse.rb
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
Warming up --------------------------------------
Time.iso8601 18.460k i/100ms
Time.parse 5.987k i/100ms
Calculating -------------------------------------
Time.iso8601 182.317k (± 3.5%) i/s - 923.000k in 5.069014s
Time.parse 60.884k (± 2.0%) i/s - 305.337k in 5.017036s
Comparison:
Time.iso8601: 182316.8 i/s
Time.parse: 60883.5 i/s - 2.99x (± 0.00) slower