[#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:65426] [ruby-trunk - Feature #10329] [PATCH 2/1] optimize: foo == "literal string"
Issue #10329 has been updated by Eric Wong.
Related to Feature #10326: [PATCH] optimize: recv << "literal string" added
----------------------------------------
Feature #10329: [PATCH 2/1] optimize: foo == "literal string"
https://bugs.ruby-lang.org/issues/10329#change-49213
* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee:
* Category: core
* Target version: current: 2.2.0
----------------------------------------
Follow-up-to: [Feature #10326] (optimize: recv << "literal string")
This speeds up some string comparisons greatly, vm2_streq1 results:
[["loop_whileloop2",
[[0.21688890410587192,
0.21697380719706416,
0.21685226494446397,
0.21750432904809713],
[0.21682232478633523,
0.2153299949131906,
0.21504606027156115,
0.21595032326877117]]],
["vm2_streq1",
[[0.8923470871523023,
0.9007423971779644,
0.8952413029037416,
0.9235154730267823],
[0.42798056406900287,
0.3970582918263972,
0.4244600120000541,
0.4243976562283933]]]]
Elapsed time: 7.020550268 (sec)
-----------------------------------------------------------
benchmark results:
minimum results in each 4 measurements.
Execution time (sec)
name a b
loop_whileloop2 0.217 0.215
vm2_streq1* 0.675 0.182
Speedup ratio: compare with the result of `a' (greater is better)
name b
loop_whileloop2 1.008
vm2_streq1* 3.711
I have not figured out the reverse (yoda condition), yet:
"literal string" == foo
---
benchmark/bm_vm2_streq1.rb | 6 ++++++
compile.c | 23 +++++++++++++++++++++++
insns.def | 21 +++++++++++++++++++++
test/ruby/test_string.rb | 29 +++++++++++++++++++++++++++++
4 files changed, 79 insertions(+)
create mode 100644 benchmark/bm_vm2_streq1.rb
---Files--------------------------------
0002-optimize-foo-literal-string.patch (4.36 KB)
--
https://bugs.ruby-lang.org/