File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -295,15 +295,15 @@ $ ruby -v code/enumerable/each_with_index-vs-while-loop.rb
295
295
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
296
296
297
297
Calculating -------------------------------------
298
- each_with_index 13.138k i/100ms
299
- While Loop 23.385k i/100ms
298
+ While Loop 22.553k i/100ms
299
+ each_with_index 11.963k i/100ms
300
300
-------------------------------------------------
301
- each_with_index 140.303k (± 5.3 %) i/s - 709.452k
302
- While Loop 276.221k (± 5.3 %) i/s - 1.380M
301
+ While Loop 240.752k (± 7.1 %) i/s - 1.218M
302
+ each_with_index 126.753k (± 5.9 %) i/s - 634.039k
303
303
304
304
Comparison:
305
- While Loop: 276221.4 i/s
306
- each_with_index: 140302.7 i/s - 1.97x slower
305
+ While Loop: 240752.1 i/s
306
+ each_with_index: 126753.4 i/s - 1.90x slower
307
307
```
308
308
309
309
##### ` Enumerable#map ` ...` Array#flatten ` vs ` Enumerable#flat_map ` [ code] ( code/enumerable/map-flatten-vs-flat_map.rb )
You can’t perform that action at this time.
0 commit comments