Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ruby/irb] Optimize show_source command further
ruby/irb#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. ruby/irb@27dd2867cd
- Loading branch information