forked from fastruby/fast-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruby-3.1.3.fastruby
922 lines (800 loc) · 40.3 KB
/
ruby-3.1.3.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.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Function with single Array argument
478.821k i/100ms
Function with splat arguments
9.813k i/100ms
Calculating -------------------------------------
Function with single Array argument
4.646M (± 2.7%) i/s - 23.462M in 5.054310s
Function with splat arguments
69.681k (±18.6%) i/s - 343.455k in 5.083493s
Comparison:
Function with single Array argument: 4645527.6 i/s
Function with splat arguments: 69680.7 i/s - 66.67x (± 0.00) slower
$ ruby -v code/general/assignment.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Parallel Assignment 770.523k i/100ms
Sequential Assignment
813.214k i/100ms
Calculating -------------------------------------
Parallel Assignment 7.634M (± 5.1%) i/s - 38.526M in 5.061297s
Sequential Assignment
8.042M (± 3.0%) i/s - 40.661M in 5.060839s
Comparison:
Sequential Assignment: 8042173.5 i/s
Parallel Assignment: 7633568.1 i/s - same-ish: difference falls within error
$ ruby -v code/general/attr-accessor-vs-getter-and-setter.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
getter_and_setter 295.089k i/100ms
attr_accessor 330.027k i/100ms
Calculating -------------------------------------
getter_and_setter 2.923M (± 2.6%) i/s - 14.754M in 5.050738s
attr_accessor 3.236M (± 2.5%) i/s - 16.171M in 5.000183s
Comparison:
attr_accessor: 3236172.1 i/s
getter_and_setter: 2923292.1 i/s - 1.11x (± 0.00) slower
$ ruby -v code/general/begin-rescue-vs-respond-to.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
begin...rescue 55.268k i/100ms
respond_to? 443.320k i/100ms
Calculating -------------------------------------
begin...rescue 561.265k (± 4.0%) i/s - 2.819M in 5.030488s
respond_to? 4.416M (± 2.8%) i/s - 22.166M in 5.023883s
Comparison:
respond_to?: 4415710.3 i/s
begin...rescue: 561264.5 i/s - 7.87x (± 0.00) slower
$ ruby -v code/general/block-apply-method.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
normal 179.442k i/100ms
&method 69.168k i/100ms
Calculating -------------------------------------
normal 1.787M (± 2.7%) i/s - 8.972M in 5.023968s
&method 696.335k (± 3.8%) i/s - 3.528M in 5.073702s
Comparison:
normal: 1787208.3 i/s
&method: 696334.7 i/s - 2.57x (± 0.00) slower
$ ruby -v code/general/define_method-vs-module-eval.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
module_eval with string
144.000 i/100ms
define_method 207.000 i/100ms
Calculating -------------------------------------
module_eval with string
1.516k (±15.7%) i/s - 7.200k in 5.066947s
define_method 2.047k (±17.8%) i/s - 9.522k in 5.081551s
Comparison:
define_method: 2047.4 i/s
module_eval with string: 1515.9 i/s - same-ish: difference falls within error
$ ruby -v code/general/format-vs-round-and-to-s.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Float#round 115.921k i/100ms
Kernel#format 124.569k i/100ms
String#% 103.354k i/100ms
Calculating -------------------------------------
Float#round 1.154M (± 3.4%) i/s - 5.796M in 5.027751s
Kernel#format 1.249M (± 2.9%) i/s - 6.353M in 5.090084s
String#% 1.062M (± 3.0%) i/s - 5.374M in 5.066680s
Comparison:
Kernel#format: 1249216.7 i/s
Float#round: 1154207.2 i/s - 1.08x (± 0.00) slower
String#%: 1061784.6 i/s - 1.18x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct-on-access.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash 577.247k i/100ms
OpenStruct 295.136k i/100ms
Calculating -------------------------------------
Hash 5.792M (± 1.3%) i/s - 29.440M in 5.083632s
OpenStruct 2.972M (± 0.5%) i/s - 15.052M in 5.063959s
Comparison:
Hash: 5792122.6 i/s
OpenStruct: 2972452.9 i/s - 1.95x (± 0.00) slower
$ ruby -v code/general/hash-vs-openstruct.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash 726.837k i/100ms
OpenStruct 6.260k i/100ms
Calculating -------------------------------------
Hash 7.551M (± 3.8%) i/s - 37.796M in 5.012665s
OpenStruct 63.063k (± 4.4%) i/s - 319.260k in 5.073114s
Comparison:
Hash: 7551246.9 i/s
OpenStruct: 63063.2 i/s - 119.74x (± 0.00) slower
$ ruby -v code/general/inheritance-check.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
less than or equal 384.686k i/100ms
ancestors.include? 63.297k i/100ms
Calculating -------------------------------------
less than or equal 3.825M (± 4.4%) i/s - 19.234M in 5.039507s
ancestors.include? 706.393k (± 2.1%) i/s - 3.545M in 5.020162s
Comparison:
less than or equal: 3824858.5 i/s
ancestors.include?: 706393.1 i/s - 5.41x (± 0.00) slower
$ ruby -v code/general/loop-vs-while-true.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
While Loop 1.000 i/100ms
Kernel loop 1.000 i/100ms
Calculating -------------------------------------
While Loop 0.527 (± 0.0%) i/s - 3.000 in 5.688883s
Kernel loop 0.143 (± 0.0%) i/s - 1.000 in 6.981510s
Comparison:
While Loop: 0.5 i/s
Kernel loop: 0.1 i/s - 3.68x (± 0.00) slower
$ ruby -v code/general/raise-vs-e2mmap.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
$ ruby -v code/array/array-first-vs-index.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#[0] 1.127M i/100ms
Array#first 934.965k i/100ms
Calculating -------------------------------------
Array#[0] 10.727M (± 4.2%) i/s - 54.095M in 5.052349s
Array#first 8.607M (± 4.3%) i/s - 43.008M in 5.006470s
Comparison:
Array#[0]: 10726776.9 i/s
Array#first: 8607000.9 i/s - 1.25x (± 0.00) slower
$ ruby -v code/array/array-last-vs-index.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#[-1] 1.018M i/100ms
Array#last 875.150k i/100ms
Calculating -------------------------------------
Array#[-1] 10.615M (± 2.8%) i/s - 53.972M in 5.088728s
Array#last 8.859M (± 3.3%) i/s - 44.633M in 5.043921s
Comparison:
Array#[-1]: 10614786.7 i/s
Array#last: 8858889.3 i/s - 1.20x (± 0.00) slower
$ ruby -v code/array/bsearch-vs-find.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
find 1.000 i/100ms
bsearch 49.590k i/100ms
Calculating -------------------------------------
find 0.153 (± 0.0%) i/s - 1.000 in 6.546269s
bsearch 534.835k (± 2.1%) i/s - 2.678M in 5.009081s
Comparison:
bsearch: 534835.5 i/s
find: 0.2 i/s - 3501177.28x (± 0.00) slower
$ ruby -v code/array/insert-vs-unshift.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#unshift 10.000 i/100ms
Array#insert 1.000 i/100ms
Calculating -------------------------------------
Array#unshift 104.233 (± 2.9%) i/s - 530.000 in 5.089944s
Array#insert 0.443 (± 0.0%) i/s - 3.000 in 6.767490s
Comparison:
Array#unshift: 104.2 i/s
Array#insert: 0.4 i/s - 235.11x (± 0.00) slower
$ ruby -v code/array/length-vs-size-vs-count.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#length 1.491M i/100ms
Array#size 1.509M i/100ms
Array#count 1.102M i/100ms
Calculating -------------------------------------
Array#length 14.876M (± 2.0%) i/s - 74.554M in 5.013881s
Array#size 15.052M (± 1.2%) i/s - 75.446M in 5.013048s
Array#count 10.988M (± 2.5%) i/s - 55.099M in 5.017802s
Comparison:
Array#size: 15052241.2 i/s
Array#length: 14875686.7 i/s - same-ish: difference falls within error
Array#count: 10987892.2 i/s - 1.37x (± 0.00) slower
$ ruby -v code/array/shuffle-first-vs-sample.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#shuffle.first 27.749k i/100ms
Array#sample 722.539k i/100ms
Calculating -------------------------------------
Array#shuffle.first 276.839k (± 3.0%) i/s - 1.387M in 5.016538s
Array#sample 7.098M (± 2.7%) i/s - 36.127M in 5.093730s
Comparison:
Array#sample: 7097624.6 i/s
Array#shuffle.first: 276838.8 i/s - 25.64x (± 0.00) slower
$ ruby -v code/date/iso8601-vs-parse.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Date.iso8601 39.617k i/100ms
Date.parse 20.584k i/100ms
Calculating -------------------------------------
Date.iso8601 397.119k (± 3.2%) i/s - 2.020M in 5.093402s
Date.parse 199.365k (± 2.7%) i/s - 1.009M in 5.062995s
Comparison:
Date.iso8601: 397118.6 i/s
Date.parse: 199364.9 i/s - 1.99x (± 0.00) slower
$ ruby -v code/enumerable/each-push-vs-map.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#each + push 10.287k i/100ms
Array#map 14.444k i/100ms
Calculating -------------------------------------
Array#each + push 99.159k (± 3.5%) i/s - 504.063k in 5.089681s
Array#map 147.572k (± 3.8%) i/s - 751.088k in 5.097424s
Comparison:
Array#map: 147571.6 i/s
Array#each + push: 99159.4 i/s - 1.49x (± 0.00) slower
$ ruby -v code/enumerable/each-vs-for-loop.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
For loop 16.851k i/100ms
#each 18.166k i/100ms
Calculating -------------------------------------
For loop 171.808k (± 1.7%) i/s - 859.401k in 5.003665s
#each 186.555k (± 2.9%) i/s - 944.632k in 5.067963s
Comparison:
#each: 186555.4 i/s
For loop: 171808.4 i/s - 1.09x (± 0.00) slower
$ ruby -v code/enumerable/each_with_index-vs-while-loop.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
While Loop 23.311k i/100ms
each_with_index 11.144k i/100ms
Calculating -------------------------------------
While Loop 232.818k (± 2.2%) i/s - 1.166M in 5.008679s
each_with_index 110.132k (± 4.2%) i/s - 557.200k in 5.068901s
Comparison:
While Loop: 232818.2 i/s
each_with_index: 110132.2 i/s - 2.11x (± 0.00) slower
$ ruby -v code/enumerable/inject-symbol-vs-block.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
inject symbol 60.405k i/100ms
inject to_proc 1.306k i/100ms
inject block 1.192k i/100ms
Calculating -------------------------------------
inject symbol 619.258k (± 3.4%) i/s - 3.141M in 5.078642s
inject to_proc 12.947k (± 3.0%) i/s - 65.300k in 5.048244s
inject block 11.869k (± 2.7%) i/s - 59.600k in 5.024998s
Comparison:
inject symbol: 619258.5 i/s
inject to_proc: 12947.4 i/s - 47.83x (± 0.00) slower
inject block: 11869.4 i/s - 52.17x (± 0.00) slower
$ ruby -v code/enumerable/map-flatten-vs-flat_map.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#map.flatten(1) 4.240k i/100ms
Array#map.flatten 2.236k i/100ms
Array#flat_map 5.131k i/100ms
Calculating -------------------------------------
Array#map.flatten(1) 41.846k (± 3.8%) i/s - 212.000k in 5.073809s
Array#map.flatten 22.392k (± 2.4%) i/s - 114.036k in 5.095733s
Array#flat_map 52.224k (± 3.2%) i/s - 261.681k in 5.016322s
Comparison:
Array#flat_map: 52224.0 i/s
Array#map.flatten(1): 41846.2 i/s - 1.25x (± 0.00) slower
Array#map.flatten: 22392.0 i/s - 2.33x (± 0.00) slower
$ ruby -v code/enumerable/reverse-each-vs-reverse_each.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Array#reverse.each 16.595k i/100ms
Array#reverse_each 16.881k i/100ms
Calculating -------------------------------------
Array#reverse.each 165.808k (± 3.4%) i/s - 829.750k in 5.009942s
Array#reverse_each 171.818k (± 3.6%) i/s - 860.931k in 5.017642s
Comparison:
Array#reverse_each: 171818.3 i/s
Array#reverse.each: 165808.0 i/s - same-ish: difference falls within error
$ ruby -v code/enumerable/select-first-vs-detect.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Enumerable#select.first
11.855k i/100ms
Enumerable#detect 47.786k i/100ms
Calculating -------------------------------------
Enumerable#select.first
119.844k (± 2.8%) i/s - 2.407M in 20.098410s
Enumerable#detect 475.218k (± 3.5%) i/s - 9.509M in 20.035786s
Comparison:
Enumerable#detect: 475218.1 i/s
Enumerable#select.first: 119844.1 i/s - 3.97x (± 0.00) slower
$ ruby -v code/enumerable/select-last-vs-reverse-detect.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Enumerable#reverse.detect
141.700k i/100ms
Enumerable#select.last
9.696k i/100ms
Calculating -------------------------------------
Enumerable#reverse.detect
1.451M (± 1.8%) i/s - 7.368M in 5.078760s
Enumerable#select.last
95.966k (± 2.6%) i/s - 484.800k in 5.055281s
Comparison:
Enumerable#reverse.detect: 1451311.0 i/s
Enumerable#select.last: 95965.9 i/s - 15.12x (± 0.00) slower
$ ruby -v code/enumerable/sort-vs-sort_by.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Enumerable#sort_by (Symbol#to_proc)
2.769k i/100ms
Enumerable#sort_by 2.649k i/100ms
Enumerable#sort 1.367k i/100ms
Calculating -------------------------------------
Enumerable#sort_by (Symbol#to_proc)
27.416k (± 2.8%) i/s - 138.450k in 5.053961s
Enumerable#sort_by 26.410k (± 3.6%) i/s - 132.450k in 5.022126s
Enumerable#sort 14.042k (± 2.2%) i/s - 71.084k in 5.064571s
Comparison:
Enumerable#sort_by (Symbol#to_proc): 27416.1 i/s
Enumerable#sort_by: 26410.5 i/s - same-ish: difference falls within error
Enumerable#sort: 14042.5 i/s - 1.95x (± 0.00) slower
$ ruby -v code/enumerable/sort_by-first-vs-min_by.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Enumerable#min_by 9.504k i/100ms
Enumerable#sort_by...first
4.805k i/100ms
Calculating -------------------------------------
Enumerable#min_by 94.419k (± 1.6%) i/s - 475.200k in 5.034124s
Enumerable#sort_by...first
48.363k (± 3.0%) i/s - 245.055k in 5.071765s
Comparison:
Enumerable#min_by: 94419.3 i/s
Enumerable#sort_by...first: 48363.2 i/s - 1.95x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-dup.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash[] 188.173k i/100ms
Hash#dup 99.447k i/100ms
Calculating -------------------------------------
Hash[] 1.703M (±12.0%) i/s - 8.468M in 5.043370s
Hash#dup 1.283M (±10.4%) i/s - 6.365M in 5.014131s
Comparison:
Hash[]: 1703164.9 i/s
Hash#dup: 1282647.8 i/s - 1.33x (± 0.00) slower
$ ruby -v code/hash/bracket-vs-fetch.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#[], symbol 977.160k i/100ms
Hash#fetch, symbol 778.593k i/100ms
Hash#[], string 832.863k i/100ms
Hash#fetch, string 466.084k i/100ms
Calculating -------------------------------------
Hash#[], symbol 9.730M (± 2.3%) i/s - 48.858M in 5.024215s
Hash#fetch, symbol 7.844M (± 2.7%) i/s - 39.708M in 5.066124s
Hash#[], string 8.294M (± 1.9%) i/s - 41.643M in 5.023000s
Hash#fetch, string 4.698M (± 2.6%) i/s - 23.770M in 5.063202s
Comparison:
Hash#[], symbol: 9729865.5 i/s
Hash#[], string: 8293678.0 i/s - 1.17x (± 0.00) slower
Hash#fetch, symbol: 7843981.5 i/s - 1.24x (± 0.00) slower
Hash#fetch, string: 4698216.5 i/s - 2.07x (± 0.00) slower
$ ruby -v code/hash/dig-vs-[]-vs-fetch.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#dig 572.296k i/100ms
Hash#[] 676.302k i/100ms
Hash#[] || 609.447k i/100ms
Hash#[] && 272.936k i/100ms
Hash#fetch 394.011k i/100ms
Hash#fetch fallback 230.100k i/100ms
Calculating -------------------------------------
Hash#dig 5.702M (± 2.2%) i/s - 28.615M in 5.020728s
Hash#[] 6.708M (± 3.8%) i/s - 33.815M in 5.048784s
Hash#[] || 6.056M (± 4.6%) i/s - 30.472M in 5.042855s
Hash#[] && 2.665M (± 2.6%) i/s - 13.374M in 5.022554s
Hash#fetch 4.026M (± 2.9%) i/s - 20.489M in 5.093873s
Hash#fetch fallback 2.306M (± 2.1%) i/s - 11.735M in 5.091205s
Comparison:
Hash#[]: 6707920.6 i/s
Hash#[] ||: 6056395.5 i/s - 1.11x (± 0.00) slower
Hash#dig: 5702150.7 i/s - 1.18x (± 0.00) slower
Hash#fetch: 4025618.2 i/s - 1.67x (± 0.00) slower
Hash#[] &&: 2664659.5 i/s - 2.52x (± 0.00) slower
Hash#fetch fallback: 2306034.8 i/s - 2.91x (± 0.00) slower
$ ruby -v code/hash/fetch-vs-fetch-with-block.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#fetch + const 946.925k i/100ms
Hash#fetch + block 930.805k i/100ms
Hash#fetch + arg 659.833k i/100ms
Calculating -------------------------------------
Hash#fetch + const 9.522M (± 3.1%) i/s - 48.293M in 5.076663s
Hash#fetch + block 9.132M (± 3.6%) i/s - 45.609M in 5.000946s
Hash#fetch + arg 6.572M (± 4.0%) i/s - 32.992M in 5.028070s
Comparison:
Hash#fetch + const: 9522074.2 i/s
Hash#fetch + block: 9131907.2 i/s - same-ish: difference falls within error
Hash#fetch + arg: 6572233.5 i/s - 1.45x (± 0.00) slower
$ ruby -v code/hash/hash-key-sort_by-vs-sort.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
sort_by + to_h 14.973k i/100ms
sort + to_h 6.308k i/100ms
Calculating -------------------------------------
sort_by + to_h 147.915k (± 3.0%) i/s - 748.650k in 5.066016s
sort + to_h 63.907k (± 4.9%) i/s - 321.708k in 5.048582s
Comparison:
sort_by + to_h: 147915.0 i/s
sort + to_h: 63906.8 i/s - 2.31x (± 0.00) slower
$ ruby -v code/hash/keys-each-vs-each_key.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.each 104.784k i/100ms
Hash#each_key 112.870k i/100ms
Calculating -------------------------------------
Hash#keys.each 1.052M (± 3.4%) i/s - 5.344M in 5.086771s
Hash#each_key 1.125M (± 4.0%) i/s - 5.644M in 5.027003s
Comparison:
Hash#each_key: 1124614.4 i/s
Hash#keys.each: 1051819.8 i/s - same-ish: difference falls within error
$ ruby -v code/hash/keys-include-vs-key.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#keys.include? 762.000 i/100ms
Hash#key? 661.824k i/100ms
Calculating -------------------------------------
Hash#keys.include? 7.649k (± 7.3%) i/s - 38.100k in 5.009387s
Hash#key? 6.556M (± 5.6%) i/s - 33.091M in 5.063857s
Comparison:
Hash#key?: 6556354.0 i/s
Hash#keys.include?: 7648.7 i/s - 857.19x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-[]=.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#merge! 2.304k i/100ms
Hash#[]= 5.316k i/100ms
Calculating -------------------------------------
Hash#merge! 22.570k (± 4.0%) i/s - 112.896k in 5.010756s
Hash#[]= 52.142k (± 3.8%) i/s - 260.484k in 5.003555s
Comparison:
Hash#[]=: 52142.5 i/s
Hash#merge!: 22569.8 i/s - 2.31x (± 0.00) slower
$ ruby -v code/hash/merge-bang-vs-merge-vs-dup-merge-bang.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
{}#merge!(Hash) do end
2.824k i/100ms
Hash#merge({}) 2.336k i/100ms
Hash#dup#merge!({}) 1.645k i/100ms
Calculating -------------------------------------
{}#merge!(Hash) do end
27.885k (± 4.6%) i/s - 141.200k in 5.075922s
Hash#merge({}) 23.061k (± 2.6%) i/s - 116.800k in 5.068606s
Hash#dup#merge!({}) 16.081k (± 4.4%) i/s - 80.605k in 5.022459s
Comparison:
{}#merge!(Hash) do end: 27885.1 i/s
Hash#merge({}): 23060.5 i/s - 1.21x (± 0.00) slower
Hash#dup#merge!({}): 16080.9 i/s - 1.73x (± 0.00) slower
$ ruby -v code/hash/merge-vs-double-splat-operator.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#**other 225.050k i/100ms
Hash#merge 197.047k i/100ms
Calculating -------------------------------------
Hash#**other 2.213M (± 3.4%) i/s - 11.252M in 5.091307s
Hash#merge 2.039M (± 3.3%) i/s - 10.246M in 5.030584s
Comparison:
Hash#**other: 2212818.4 i/s
Hash#merge: 2039015.8 i/s - 1.09x (± 0.00) slower
$ ruby -v code/hash/merge-vs-merge-bang.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#merge 808.000 i/100ms
Hash#merge! 2.314k i/100ms
Calculating -------------------------------------
Hash#merge 8.483k (± 5.7%) i/s - 42.824k in 5.064729s
Hash#merge! 23.893k (± 4.5%) i/s - 120.328k in 5.046348s
Comparison:
Hash#merge!: 23893.1 i/s
Hash#merge: 8483.2 i/s - 2.82x (± 0.00) slower
$ ruby -v code/hash/slice-native-vs-before-native.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#native-slice 261.431k i/100ms
Array#each 132.185k i/100ms
Array#each_w/_object 93.982k i/100ms
Hash#select-include 35.483k i/100ms
Calculating -------------------------------------
Hash#native-slice 2.418M (± 3.3%) i/s - 12.287M in 5.087087s
Array#each 1.294M (± 2.3%) i/s - 6.477M in 5.006695s
Array#each_w/_object 949.447k (± 2.2%) i/s - 4.793M in 5.050940s
Hash#select-include 358.986k (± 4.6%) i/s - 1.810M in 5.051805s
Comparison:
Hash#native-slice : 2418216.2 i/s
Array#each : 1294381.3 i/s - 1.87x (± 0.00) slower
Array#each_w/_object: 949446.8 i/s - 2.55x (± 0.00) slower
Hash#select-include : 358986.3 i/s - 6.74x (± 0.00) slower
$ ruby -v code/hash/values-include-vs-value.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Hash#values.include? 1.002k i/100ms
Hash#value? 1.030k i/100ms
Calculating -------------------------------------
Hash#values.include? 10.210k (± 7.0%) i/s - 51.102k in 5.033048s
Hash#value? 11.133k (± 3.5%) i/s - 56.650k in 5.094877s
Comparison:
Hash#value?: 11133.0 i/s
Hash#values.include?: 10210.0 i/s - same-ish: difference falls within error
$ ruby -v code/method/call-vs-send-vs-method_missing.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
call 403.488k i/100ms
send 311.159k i/100ms
method_missing 229.564k i/100ms
Calculating -------------------------------------
call 3.992M (± 2.4%) i/s - 20.174M in 5.057342s
send 3.063M (± 2.2%) i/s - 15.558M in 5.081499s
method_missing 2.233M (± 2.5%) i/s - 11.249M in 5.040002s
Comparison:
call: 3991533.2 i/s
send: 3063228.5 i/s - 1.30x (± 0.00) slower
method_missing: 2233321.6 i/s - 1.79x (± 0.00) slower
$ ruby -v code/proc-and-block/block-vs-to_proc.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Block 4.663k i/100ms
Symbol#to_proc 5.024k i/100ms
Calculating -------------------------------------
Block 46.113k (± 2.9%) i/s - 233.150k in 5.060503s
Symbol#to_proc 49.596k (± 3.0%) i/s - 251.200k in 5.069860s
Comparison:
Symbol#to_proc: 49595.6 i/s
Block: 46112.7 i/s - 1.08x (± 0.00) slower
$ ruby -v code/proc-and-block/proc-call-vs-yield.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
block.call 630.346k i/100ms
block + yield 679.071k i/100ms
unused block 874.884k i/100ms
yield 848.909k i/100ms
Calculating -------------------------------------
block.call 6.298M (± 3.1%) i/s - 31.517M in 5.009186s
block + yield 6.865M (± 2.1%) i/s - 34.633M in 5.046882s
unused block 8.842M (± 2.0%) i/s - 44.619M in 5.048388s
yield 8.455M (± 2.6%) i/s - 42.445M in 5.023954s
Comparison:
unused block: 8841830.2 i/s
yield: 8454775.3 i/s - same-ish: difference falls within error
block + yield: 6865397.6 i/s - 1.29x (± 0.00) slower
block.call: 6298377.3 i/s - 1.40x (± 0.00) slower
$ ruby -v code/range/cover-vs-include.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
range#cover? 194.241k i/100ms
range#include? 7.236k i/100ms
range#member? 7.382k i/100ms
plain compare 272.132k i/100ms
Calculating -------------------------------------
range#cover? 1.926M (± 1.7%) i/s - 9.712M in 5.045289s
range#include? 75.299k (± 5.6%) i/s - 376.272k in 5.012383s
range#member? 75.983k (± 3.8%) i/s - 383.864k in 5.059118s
plain compare 2.777M (± 4.8%) i/s - 13.879M in 5.009970s
Comparison:
plain compare: 2776540.5 i/s
range#cover?: 1925573.0 i/s - 1.44x (± 0.00) slower
range#member?: 75983.4 i/s - 36.54x (± 0.00) slower
range#include?: 75299.2 i/s - 36.87x (± 0.00) slower
$ ruby -v code/string/===-vs-=~-vs-match.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#match? 583.852k i/100ms
String#=~ 375.066k i/100ms
Regexp#=== 336.500k i/100ms
String#match 273.809k i/100ms
Calculating -------------------------------------
String#match? 5.667M (± 1.8%) i/s - 28.609M in 5.050091s
String#=~ 3.570M (± 1.5%) i/s - 18.003M in 5.043652s
Regexp#=== 3.403M (± 2.5%) i/s - 17.162M in 5.046031s
String#match 2.719M (± 3.9%) i/s - 13.690M in 5.044185s
Comparison:
String#match?: 5666881.5 i/s
String#=~: 3570317.7 i/s - 1.59x (± 0.00) slower
Regexp#===: 3403206.6 i/s - 1.67x (± 0.00) slower
String#match: 2718677.6 i/s - 2.08x (± 0.00) slower
$ ruby -v code/string/casecmp-vs-downcase-==.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#downcase + == 370.597k i/100ms
String#casecmp 489.385k i/100ms
Calculating -------------------------------------
String#downcase + == 3.657M (± 2.6%) i/s - 18.530M in 5.070165s
String#casecmp 4.851M (± 3.7%) i/s - 24.469M in 5.051843s
Comparison:
String#casecmp: 4851041.0 i/s
String#downcase + ==: 3657254.7 i/s - 1.33x (± 0.00) slower
$ ruby -v code/string/concatenation.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#+ 347.130k i/100ms
String#concat 358.571k i/100ms
String#append 388.098k i/100ms
"foo" "bar" 774.663k i/100ms
"#{'foo'}#{'bar'}" 789.207k i/100ms
Calculating -------------------------------------
String#+ 3.480M (± 2.7%) i/s - 17.704M in 5.091285s
String#concat 3.552M (± 2.9%) i/s - 17.929M in 5.051442s
String#append 3.929M (± 3.7%) i/s - 19.793M in 5.044343s
"foo" "bar" 7.673M (± 3.7%) i/s - 38.733M in 5.054917s
"#{'foo'}#{'bar'}" 7.683M (± 2.9%) i/s - 38.671M in 5.037982s
Comparison:
"#{'foo'}#{'bar'}": 7682592.8 i/s
"foo" "bar": 7673399.4 i/s - same-ish: difference falls within error
String#append: 3929437.3 i/s - 1.96x (± 0.00) slower
String#concat: 3552303.5 i/s - 2.16x (± 0.00) slower
String#+: 3479817.5 i/s - 2.21x (± 0.00) slower
$ ruby -v code/string/dup-vs-unary-plus.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#+@ 636.568k i/100ms
String#dup 317.703k i/100ms
Calculating -------------------------------------
String#+@ 6.588M (± 2.1%) i/s - 33.102M in 5.026818s
String#dup 3.219M (± 2.1%) i/s - 16.203M in 5.035563s
Comparison:
String#+@: 6587840.5 i/s
String#dup: 3219181.6 i/s - 2.05x (± 0.00) slower
$ ruby -v code/string/end-string-checking-match-vs-end_with.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#=~ 112.873k i/100ms
String#match? 247.524k i/100ms
String#end_with? 360.814k i/100ms
Calculating -------------------------------------
String#=~ 1.141M (± 2.3%) i/s - 5.757M in 5.048804s
String#match? 2.449M (± 3.8%) i/s - 12.376M in 5.062292s
String#end_with? 3.658M (± 2.5%) i/s - 18.402M in 5.033669s
Comparison:
String#end_with?: 3658077.0 i/s
String#match?: 2448598.2 i/s - 1.49x (± 0.00) slower
String#=~: 1140831.1 i/s - 3.21x (± 0.00) slower
$ ruby -v code/string/gsub-vs-sub.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#gsub 65.405k i/100ms
String#sub 88.622k i/100ms
String#dup["string"]=
111.702k i/100ms
Calculating -------------------------------------
String#gsub 659.091k (± 2.1%) i/s - 3.336M in 5.063281s
String#sub 883.980k (± 2.2%) i/s - 4.431M in 5.015018s
String#dup["string"]=
1.116M (± 3.0%) i/s - 5.585M in 5.008712s
Comparison:
String#dup["string"]=: 1116127.8 i/s
String#sub: 883979.6 i/s - 1.26x (± 0.00) slower
String#gsub: 659090.7 i/s - 1.69x (± 0.00) slower
$ ruby -v code/string/gsub-vs-tr.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#gsub 57.760k i/100ms
String#tr 215.709k i/100ms
Calculating -------------------------------------
String#gsub 577.092k (± 2.4%) i/s - 2.888M in 5.007221s
String#tr 2.124M (± 2.3%) i/s - 10.785M in 5.080562s
Comparison:
String#tr: 2124035.1 i/s
String#gsub: 577092.3 i/s - 3.68x (± 0.00) slower
$ ruby -v code/string/mutable_vs_immutable_strings.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Without Freeze 771.761k i/100ms
With Freeze 1.198M i/100ms
Calculating -------------------------------------
Without Freeze 7.915M (± 0.9%) i/s - 40.132M in 5.070715s
With Freeze 12.024M (± 1.7%) i/s - 61.106M in 5.083411s
Comparison:
With Freeze: 12024133.5 i/s
Without Freeze: 7914985.5 i/s - 1.52x (± 0.00) slower
$ ruby -v code/string/remove-extra-spaces-or-other-chars.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#gsub/regex+/ 2.006k i/100ms
String#squeeze 107.386k i/100ms
Calculating -------------------------------------
String#gsub/regex+/ 20.129k (± 3.1%) i/s - 102.306k in 5.087829s
String#squeeze 1.071M (± 2.8%) i/s - 5.369M in 5.017133s
Comparison:
String#squeeze: 1071052.4 i/s
String#gsub/regex+/: 20129.4 i/s - 53.21x (± 0.00) slower
$ ruby -v code/string/start-string-checking-match-vs-start_with.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#=~ 169.085k i/100ms
String#match? 429.581k i/100ms
String#start_with? 513.313k i/100ms
Calculating -------------------------------------
String#=~ 1.688M (± 1.7%) i/s - 8.454M in 5.008646s
String#match? 4.365M (± 3.9%) i/s - 21.909M in 5.026911s
String#start_with? 5.264M (± 2.5%) i/s - 26.692M in 5.074028s
Comparison:
String#start_with?: 5264040.8 i/s
String#match?: 4365395.1 i/s - 1.21x (± 0.00) slower
String#=~: 1688448.7 i/s - 3.12x (± 0.00) slower
$ ruby -v code/string/start_with-vs-substring-==.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#start_with? 142.990k i/100ms
String#[0, n] == 48.002k i/100ms
String#[RANGE] == 43.198k i/100ms
String#[0...n] == 27.222k i/100ms
Calculating -------------------------------------
String#start_with? 1.415M (± 4.4%) i/s - 7.150M in 5.062274s
String#[0, n] == 486.146k (± 2.7%) i/s - 2.448M in 5.039617s
String#[RANGE] == 423.687k (± 3.3%) i/s - 2.117M in 5.001617s
String#[0...n] == 273.612k (± 2.7%) i/s - 1.388M in 5.077791s
Comparison:
String#start_with?: 1415369.5 i/s
String#[0, n] ==: 486146.0 i/s - 2.91x (± 0.00) slower
String#[RANGE] ==: 423686.6 i/s - 3.34x (± 0.00) slower
String#[0...n] ==: 273611.9 i/s - 5.17x (± 0.00) slower
$ ruby -v code/string/sub!-vs-gsub!-vs-[]=.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#['string']= 109.747k i/100ms
String#sub!'string' 78.184k i/100ms
String#gsub!'string' 46.087k i/100ms
String#[/regexp/]= 97.728k i/100ms
String#sub!/regexp/ 75.064k i/100ms
String#gsub!/regexp/ 38.351k i/100ms
Calculating -------------------------------------
String#['string']= 1.069M (± 2.1%) i/s - 5.378M in 5.031688s
String#sub!'string' 766.114k (± 3.4%) i/s - 3.831M in 5.006614s
String#gsub!'string' 467.019k (± 3.9%) i/s - 2.350M in 5.040755s
String#[/regexp/]= 946.799k (± 3.8%) i/s - 4.789M in 5.065842s
String#sub!/regexp/ 706.437k (± 4.7%) i/s - 3.528M in 5.007959s
String#gsub!/regexp/ 367.641k (± 4.9%) i/s - 1.841M in 5.020627s
Comparison:
String#['string']=: 1069271.2 i/s
String#[/regexp/]=: 946799.3 i/s - 1.13x (± 0.00) slower
String#sub!'string': 766113.9 i/s - 1.40x (± 0.00) slower
String#sub!/regexp/: 706436.8 i/s - 1.51x (± 0.00) slower
String#gsub!'string': 467019.0 i/s - 2.29x (± 0.00) slower
String#gsub!/regexp/: 367640.6 i/s - 2.91x (± 0.00) slower
$ ruby -v code/string/sub-vs-chomp-vs-delete_suffix.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#sub 96.215k i/100ms
String#chomp 314.803k i/100ms
String#delete_suffix 334.137k i/100ms
Calculating -------------------------------------
String#sub 964.832k (± 2.2%) i/s - 4.907M in 5.088310s
String#chomp 3.205M (± 5.3%) i/s - 16.055M in 5.027178s
String#delete_suffix 3.291M (± 3.3%) i/s - 16.707M in 5.081803s
Comparison:
String#delete_suffix: 3291264.7 i/s
String#chomp: 3204916.0 i/s - same-ish: difference falls within error
String#sub: 964832.0 i/s - 3.41x (± 0.00) slower
$ ruby -v code/string/sub-vs-delete_prefix.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#delete_prefix 354.052k i/100ms
String#sub 96.640k i/100ms
Calculating -------------------------------------
String#delete_prefix 3.591M (± 1.7%) i/s - 18.057M in 5.029313s
String#sub 957.264k (± 2.0%) i/s - 4.832M in 5.049811s
Comparison:
String#delete_prefix: 3591307.9 i/s
String#sub: 957263.6 i/s - 3.75x (± 0.00) slower
$ ruby -v code/string/unpack1-vs-unpack[0].rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
String#unpack1 375.984k i/100ms
String#unpack[0] 281.155k i/100ms
Calculating -------------------------------------
String#unpack1 3.744M (± 1.7%) i/s - 18.799M in 5.022263s
String#unpack[0] 2.764M (± 3.2%) i/s - 14.058M in 5.092594s
Comparison:
String#unpack1: 3744235.3 i/s
String#unpack[0]: 2763510.0 i/s - 1.35x (± 0.00) slower
$ ruby -v code/time/iso8601-vs-parse.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Warming up --------------------------------------
Time.iso8601 17.422k i/100ms
Time.parse 5.452k i/100ms
Calculating -------------------------------------
Time.iso8601 175.362k (± 3.4%) i/s - 888.522k in 5.072807s
Time.parse 56.770k (± 3.5%) i/s - 283.504k in 5.000429s
Comparison:
Time.iso8601: 175362.5 i/s
Time.parse: 56769.6 i/s - 3.09x (± 0.00) slower