[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:83000] [Ruby trunk Feature#13602][Rejected] Optimize instance variable access if $VERBOSE is not true when compiling
From:
merch-redmine@...
Date:
2017-09-25 16:26:15 UTC
List:
ruby-core #83000
Issue #13602 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Feedback to Rejected
ko1 (Koichi Sasada) wrote:
> It seems 5% can not justify this kind of optimization.
>
> We can use your technique when we revert all of optimized instructions when $VERBOSE was changed. But I'm not sure this kind of modification is valuable than implementation cost (it can be).
I think this can be rejected then. Reverting the optimized instructions would require compiling both the unoptimized version and the optimized version and keeping both in memory, or recompiling on a change to $VERBOSE, neither of which seems like a reasonable approach considering the modest performance improvement.
----------------------------------------
Feature #13602: Optimize instance variable access if $VERBOSE is not true when compiling
https://bugs.ruby-lang.org/issues/13602#change-66910
* Author: jeremyevans0 (Jeremy Evans)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
This patch optimizes instance variable lookup in the case the $VERBOSE
is not true when compiling. If $VERBOSE is not true when compiling
code, it makes the instance variable access use an optimized VM
instruction that does not check $VERBOSE at runtime.
This does not change the behavior if $VERBOSE is not changed at runtime,
only when $VERBOSE is not true when compiling the code, but is true when
running it. In the case where $VERBOSE is not true when compiling and
true at runtime, this patch makes ruby no longer emit the warning
message.
Using a similar benchmark as #10396:
~~~
require 'benchmark/ips'
class A
def initialize
@c = @d = @e = @f = nil
end
def b
@c || @d || @e || @f
end
end
Benchmark.ips do |x|
x.report("A.new.b"){A.new.b}
x.report("A.allocate.b"){A.allocate.b}
end
~~~
Before Patch:
~~~
A.new.b 347.380k (_ 1.7%) i/s - 1.741M
A.allocate.b 862.884k (_ 0.4%) i/s - 4.317M
A.new.b 338.830k (_ 1.7%) i/s - 1.706M
A.allocate.b 848.036k (_ 0.4%) i/s - 4.254M
A.new.b 344.167k (_ 1.7%) i/s - 1.731M
A.allocate.b 826.183k (_ 0.4%) i/s - 4.138M
~~~
After Patch:
~~~
A.new.b 350.251k (_ 1.7%) i/s - 1.753M
A.allocate.b 900.666k (_ 0.7%) i/s - 4.512M
A.new.b 349.868k (_ 1.7%) i/s - 1.760M
A.allocate.b 898.292k (_ 0.4%) i/s - 4.505M
A.new.b 349.690k (_ 1.7%) i/s - 1.751M
A.allocate.b 888.524k (_ 0.6%) i/s - 4.444M
~~~
So about a 1-2% increase in the case where instance variables are
already initialized, and about 5-7% increase in the case where
instance variables are not initialized.
---Files--------------------------------
0001-Optimize-instance-variable-access-if-VERBOSE-is-not-.patch (4.88 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>