diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-09 02:12:52 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-09 02:12:52 +0000 |
commit | 107f7ad6f98562e36d5b3d508c0d73dbfe197d09 (patch) | |
tree | 46f2bac5e667bec97a0dec153aecbf7086093133 /ChangeLog | |
parent | 47a5055570d0f51b0247c1770e5c24bfb3c8bfb8 (diff) | |
download | ruby-107f7ad6f98562e36d5b3d508c0d73dbfe197d09.tar.gz |
* lib/delegate.rb: Remove backtrace cleaning for delegated methods
This patch was provided by Rafael França and greatly improves
performance when an exception is raised. [Bug #11461]
Before:
Calculating -------------------------------------
default 86.209k i/100ms
default raising 2.209k i/100ms
-------------------------------------------------
default 1.953M (±11.0%) i/s - 9.655M
default raising 21.826k (±13.5%) i/s - 108.241k
After:
Calculating -------------------------------------
default 72.211k i/100ms
default raising 34.288k i/100ms
-------------------------------------------------
default 2.013M (±18.7%) i/s - 9.460M
default raising 623.950k (± 9.7%) i/s - 3.120M
Benchmark:
require 'delegate'
require 'benchmark/ips'
class Foo
def name
'foo'
end
def bla
raise
end
end
class Bar < DelegateClass(Foo)
end
bar = Bar.new(Foo.new)
Benchmark.ips do |b|
b.report('default') { bar.name }
b.report('default raising') { bar.bla rescue nil }
end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Wed Sep 9 11:08:59 2015 Zachary Scott <zzak@ruby-lang.org> + + * lib/delegate.rb: Remove backtrace cleaning for delegated methods + This patch was provided by Rafael França and greatly improves + performance when an exception is raised. [Bug #11461] + Wed Sep 9 10:05:41 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org> * test/rubygems/test_config.rb: fix broken tests for Windows platform. |