[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] Optimize show_source command further
https://github.com/ruby/irb/pull/249 actually slowed down how
codeisconcatenated. The original way of creating
codeis 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_nltoken anyway though.https://github.com/ruby/irb/commit/27dd2867cd