mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
![]() Because it's too slow.
The rendering time in IRB has been reduced as follows:
start = Time.now
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
loop do
begin
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
next if l == "\n"
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break if @io.eof?
@line = ''
@exp_line_no = @line_no
@indent = 0
rescue TerminateLineInput
initialize_input
prompt
end
end
end
end
puts "Duration: #{Time.now - start} seconds"
0.22sec -> 0.14sec
|
||
---|---|---|
.. | ||
key_actor | ||
unicode | ||
ansi.rb | ||
config.rb | ||
general_io.rb | ||
history.rb | ||
key_actor.rb | ||
key_stroke.rb | ||
kill_ring.rb | ||
line_editor.rb | ||
reline.gemspec | ||
unicode.rb | ||
version.rb | ||
windows.rb |