1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/reline
Kazuhiro NISHIYAMA 533070bfc6
Use lines instead of split
```
% cat ~/bench-split.yml
prelude: |
  s = "foo\nbar\nbaz\n"
benchmark:
  '/(?<=\n)/': |
    s.split(/(?<=\n)/)
  '/^/': |
    s.split(/^/)
  'lines': |
    s.lines
Warming up --------------------------------------
           /(?<=\n)/   459.123k i/s -    467.844k times in 1.018994s (2.18μs/i)
                 /^/   467.922k i/s -    469.744k times in 1.003894s (2.14μs/i)
               lines     2.343M i/s -      2.424M times in 1.034677s (426.84ns/i)
Calculating -------------------------------------
           /(?<=\n)/   422.347k i/s -      1.377M times in 3.261232s (2.37μs/i)
                 /^/   477.603k i/s -      1.404M times in 2.939186s (2.09μs/i)
               lines     2.485M i/s -      7.028M times in 2.828757s (402.47ns/i)

Comparison:
               lines:   2484631.6 i/s
                 /^/:    477603.3 i/s - 5.20x  slower
           /(?<=\n)/:    422346.5 i/s - 5.88x  slower
```
2019-06-03 10:32:32 +09:00
..
helper.rb Support Meta key in Reline 2019-05-24 23:38:40 +09:00
test_config.rb Use lines instead of split 2019-06-03 10:32:32 +09:00
test_key_actor_emacs.rb The C-q is also quoted insert in emacs mode 2019-06-03 04:17:52 +09:00
test_key_actor_vi.rb The ed_move_to_beg is different from vi_first_print 2019-06-03 03:29:34 +09:00
test_key_stroke.rb Use inputrc data for keystroke setting 2019-06-01 09:06:27 +09:00
test_kill_ring.rb Add Reline as a fallback library for Readline 2019-04-30 11:44:20 +09:00
test_macro.rb Close leaked file descripters in tests 2019-06-03 03:38:39 +09:00
test_within_pipe.rb Add aliases for commands for moving macro 2019-06-03 03:41:40 +09:00