| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/reline/commit/f0e54f239b
|
|
|
|
|
|
https://github.com/ruby/reline/commit/0ae7d8b336
|
|
https://github.com/ruby/irb/commit/61fe6cfa43
|
|
https://github.com/ruby/irb/commit/24315382d0
|
|
https://github.com/ruby/reline/commit/059d39b090
|
|
https://github.com/ruby/reline/commit/d81f29a134
|
|
https://github.com/ruby/reline/commit/7e18716754
|
|
https://github.com/ruby/reline/commit/dc79ed2dd8
|
|
https://github.com/ruby/reline/commit/ac6f652a39
|
|
https://github.com/ruby/reline/commit/860be91bd7
|
|
|
|
https://github.com/ruby/irb/commit/5bc3a72ca3
|
|
https://github.com/ruby/irb/commit/7209082a11
|
|
https://github.com/ruby/irb/commit/48af34bfc2
|
|
|
|
Currently when calling any of the "FileUtils" methods on pathname `require` is called every time even though that library might already be loaded. This is slow:
We can speed it up by either checking first if the constant is already defined, or by using autoload.
Using defined speeds up the action by about 300x and using autoload is about twice as fast as that (600x faster than current require method).
I'm proposing we use autoload:
```ruby
require 'benchmark/ips'
Benchmark.ips do |x|
autoload(:FileUtils, "fileutils")
x.report("require") { require 'fileutils' }
x.report("defined") { require 'fileutils' unless defined?(FileUtils) }
x.report("autoload") { FileUtils }
x.compare!
end
# Warming up --------------------------------------
# require 3.624k i/100ms
# defined 1.465M i/100ms
# autoload 2.320M i/100ms
# Calculating -------------------------------------
# require 36.282k (± 2.4%) i/s - 184.824k in 5.097153s
# defined 14.539M (± 2.0%) i/s - 73.260M in 5.041161s
# autoload 23.100M (± 1.9%) i/s - 115.993M in 5.023271s
# Comparison:
# autoload: 23099779.2 i/s
# defined: 14538544.9 i/s - 1.59x (± 0.00) slower
# require: 36282.3 i/s - 636.67x (± 0.00) slower
```
Because this autoload is scoped to Pathname it will not change the behavior of existing programs that are not expecting FileUtils to be loaded yet:
```
ruby -rpathname -e "class Pathname; autoload(:FileUtils, 'fileutils'); end; puts FileUtils.exist?"
Traceback (most recent call last):
-e:1:in `<main>': uninitialized constant FileUtils (NameError)
```
Notes:
Merged: https://github.com/ruby/ruby/pull/3693
|
|
|
|
https://github.com/ruby/irb/commit/fb637bc68f
|
|
https://github.com/ruby/irb/commit/b153d587a1
|
|
https://github.com/ruby/irb/commit/077e4ae7de
|
|
https://github.com/ruby/irb/commit/f441ce35bf
|
|
- The file needed to link may be the import library.
- Remove duplicate flags.
|
|
https://github.com/ruby/irb/commit/a1fc68abaa
|
|
https://github.com/ruby/irb/commit/7c2abc14d8
|
|
https://github.com/ruby/irb/commit/92cce941cb
|
|
|
|
|
|
|
|
https://github.com/ruby/reline/commit/6e0ea3362a
|
|
https://github.com/ruby/reline/commit/71c2eb143d
|
|
https://github.com/ruby/reline/commit/5e3ea74891
|
|
For compatibility with ext/readline.
https://github.com/ruby/reline/commit/13d9b936bc
|
|
https://github.com/ruby/reline/commit/9b1913567a
|
|
https://github.com/ruby/reline/commit/a2e69f6277
|
|
https://github.com/ruby/reline/commit/22d0b4e5d8
|
|
https://github.com/ruby/reline/commit/3d918e4ccb
|
|
https://github.com/ruby/irb/commit/ff111173fd
|
|
https://github.com/ruby/irb/commit/2f1d989d7c
|
|
https://github.com/ruby/irb/commit/48029944a5
|
|
Reline.autocomplete=()
https://github.com/ruby/irb/commit/66178f34b9
|
|
|
|
|
|
|
|
|
|
In vm_call_method_each_type, check for c_call and c_return events before
dispatching to vm_call_ivar and vm_call_attrset. With this approach, the
call cache will still dispatch directly to those functions, so this
change will only decrease performance for the first (uncached) call, and
even then, the performance decrease is very minimal.
This approach requires that we clear the call caches when tracing is
enabled or disabled. The approach currently switches all vm_call_ivar
and vm_call_attrset call caches to vm_call_general any time tracing is
enabled or disabled. So it could theoretically result in a slowdown for
code that constantly enables or disables tracing.
This approach does not handle targeted tracepoints, but from my testing,
c_call and c_return events are not supported for targeted tracepoints,
so that shouldn't matter.
This includes a benchmark showing the performance decrease is minimal
if detectable at all.
Fixes [Bug #16383]
Fixes [Bug #10470]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/4767
|
|
https://github.com/ruby/irb/commit/9f82ae66fc
|
|
https://github.com/ruby/reline/commit/2668715509
|
|
https://github.com/ruby/reline/commit/d027dbe118
|