[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:65413] [ruby-trunk - Feature #10326] [Open] [PATCH] optimize: recv << "literal string"
Issue #10326 has been reported by Eric Wong.
----------------------------------------
Feature #10326: [PATCH] optimize: recv << "literal string"
https://bugs.ruby-lang.org/issues/10326
* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee:
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Concatenating literal strings to existing strings seems fairly common
practice, so avoid extra garbage when doing it. I don't know if escape
analysis is coming to Ruby, but this seems easier-to-do for now:
vm2_strcat
i = 0
str = ""
while i<6_000_000 # benchmark loop 2
i += 1
str << "const"
str.clear
end
trunk 1.020890216
trunk 1.018797116
trunk 0.992393447
built 0.626914306
built 0.627910138
built 0.644469095
-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name trunk built
loop_whileloop2 0.160 0.159
vm2_strcat* 0.833 0.468
Speedup ratio: compare with the result of `trunk' (greater is better)
name built
loop_whileloop2 1.006
vm2_strcat* 1.779
Future optimizations:
* recv << "interpolated #{dstr}"
(immediate free + force recycle)
* elide allocation for equality comparisons:
str == "literal" and "literal" == str
* optimize << recv is IO << (str|dstr) (maybe)
---Files--------------------------------
0001-optimize-recv-literal-string.patch (3.28 KB)
--
https://bugs.ruby-lang.org/