Skip to content

Commit 5cc5ae4

Browse files
committed
Fast example should comes first [ci skip]
1 parent 2ab2c75 commit 5cc5ae4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,15 @@ $ ruby -v code/enumerable/each_with_index-vs-while-loop.rb
295295
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
296296
297297
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
300300
-------------------------------------------------
301-
each_with_index 140.303k5.3%) i/s - 709.452k
302-
While Loop 276.221k (± 5.3%) i/s - 1.380M
301+
While Loop 240.752k7.1%) i/s - 1.218M
302+
each_with_index 126.753k (± 5.9%) i/s - 634.039k
303303
304304
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
307307
```
308308

309309
##### `Enumerable#map`...`Array#flatten` vs `Enumerable#flat_map` [code](code/enumerable/map-flatten-vs-flat_map.rb)

0 commit comments

Comments
 (0)