[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
Issue #13188 has been updated by Shyouhei Urabe.
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79447] [Ruby trunk Feature#8576] Add optimized method type for constant value methods
From:
ko1@...
Date:
2017-02-06 03:19:44 UTC
List:
ruby-core #79447
Issue #8576 has been updated by Koichi Sasada.
Actually, I tried this approach, but I couldn't find good improvement. I'll try it again.
----------------------------------------
Feature #8576: Add optimized method type for constant value methods
https://bugs.ruby-lang.org/issues/8576#change-62879
* Author: Charlie Somerville
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* Target version: next minor
----------------------------------------
I've written a patch adding a new method type (VM_METHOD_TYPE_CONSTVAL) for methods that only return a constant value. The patch significantly improves the performance of calls to these types of methods.
I've written a small benchmark script:
require "benchmark"
def foo
1234
end
puts Benchmark.measure {
1_000_000.times do
foo; foo; foo; foo; foo
foo; foo; foo; foo; foo
end
}
Before patch:
$ ./rb x.rb
0.620000 0.000000 0.620000 ( 0.625130)
After patch:
$ ./rb x.rb
0.300000 0.000000 0.300000 ( 0.296528)
The patch is here: https://github.com/charliesome/ruby/compare/constant-value-methods
--
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>