1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/irb
Takashi Kokubun 35c7e83bb3 [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
2021-06-27 10:52:49 +09:00
..
cmd [ruby/irb] Optimize show_source command further 2021-06-27 10:52:49 +09:00
ext [ruby/irb] Make save-history extension safe for concurrent use 2021-03-06 00:18:32 +09:00
lc [ruby/irb] Update help message for next context-mode of 4 2021-02-27 06:51:12 +09:00
.document
color.rb [ruby/irb] Added colorable keyword option 2021-04-26 21:14:52 +09:00
color_printer.rb [ruby/irb] Don't call Ruby 2.4+'s String#pretty_print 2021-03-20 20:25:32 +09:00
completion.rb [ruby/irb] Prevent the completion from crashing if rdoc is missing 2021-03-30 14:27:51 +09:00
context.rb [ruby/irb] Drop OMIT_ON_ASSIGNMENT and add :truncate option for ECHO_ON_ASSIGNMENT 2020-09-19 05:13:08 +09:00
easter-egg.rb Revert "Prefer #send over #__send__ when it is clear there is no possible conflict" 2020-11-05 20:54:34 +09:00
extend-command.rb [ruby/irb] Add show_source command 2021-04-02 16:40:06 +09:00
frame.rb
help.rb [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
init.rb [ruby/irb] Improve stackprof measure 2021-06-21 18:03:49 +09:00
input-method.rb [ruby/irb] Evaluate each toplevel statement 2021-04-03 01:17:08 +09:00
inspector.rb [ruby/irb] Make IRB::ColorPrinter.pp compatible with PP.pp 2021-01-07 22:43:40 -08:00
irb.gemspec [ruby/irb] IRB should use the latest Reline, 0.2.5 2021-05-15 19:12:57 +09:00
locale.rb
magic-file.rb
notifier.rb
output-method.rb
ruby-lex.rb [ruby/irb] Fix typo ture -> true [ci skip] 2021-04-26 21:13:42 +09:00
ruby_logo.aa [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
src_encoding.rb
version.rb [ruby/irb] Version 1.3.6 2021-06-21 17:35:46 +09:00
workspace.rb [ruby/irb] Suppress colorize on Windows tests 2021-02-11 20:31:29 +09:00
ws-for-case-2.rb
xmp.rb [ruby/irb] Prefer require_relative to load the files in this library 2020-08-18 14:38:01 +09:00