diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2021-06-27 10:48:53 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2021-06-27 10:52:49 +0900 |
| commit | 35c7e83bb32869cd96112ffd850b02047b48fac1 (patch) | |
| tree | d9255be1a32293bbfa89e45d58a46f471fdf6377 /spec/ruby/core/basicobject | |
| parent | 6eb7c663c665c633bdeae185d45e78832e672acc (diff) | |
[ruby/irb] Optimize show_source command further
https://github.com/ruby/irb/pull/249 actually slowed down how `code` is
concatenated. The original way of creating `code` is faster.
[before]
user system total real
2.420137 0.005364 2.425501 ( 2.426264)
[after]
user system total real
1.000221 0.007454 1.007675 ( 1.008295)
Theoretically, this implementation might skip lines that don't appear in
Ripper tokens, but this assumes such lines don't impact whether the code
passes compilation or not. At least normal blank lines seem to have an
`on_ignored_nl` token anyway though.
https://github.com/ruby/irb/commit/27dd2867cd
Diffstat (limited to 'spec/ruby/core/basicobject')
0 files changed, 0 insertions, 0 deletions
