[#71815] [Ruby trunk - Bug #11768] [Open] Add a polymorphic inline cache — tenderlove@...
Issue #11768 has been reported by Aaron Patterson.
tenderlove@ruby-lang.org wrote:
On Thu, Dec 03, 2015 at 10:51:08PM +0000, Eric Wong wrote:
Aaron Patterson <tenderlove@ruby-lang.org> wrote:
[#71818] [Ruby trunk - Feature #11769] [Open] optimize case / when for `nil` — tenderlove@...
Issue #11769 has been reported by Aaron Patterson.
tenderlove@ruby-lang.org wrote:
[#71931] [Ruby trunk - Feature #11786] [Open] [PATCH] micro-optimize case dispatch even harder — normalperson@...
Issue #11786 has been reported by Eric Wong.
Oops, I forgot to free the table when iseq is destroyed :x
On 2015/12/08 12:43, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
On 2015/12/08 13:53, Eric Wong wrote:
[#72028] [Ruby trunk - Feature #11405] [Assigned] [PATCH] hash.c: minor speedups to int/fixnum keys — mame@...
Issue #11405 has been updated by Yusuke Endoh.
mame@ruby-lang.org wrote:
[#72045] Ruby 2.3.0-preview2 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 2.3.0-preview2.
Please add your optimizations before RC1.
SASADA Koichi <ko1@atdot.net> wrote:
On 2015/12/11 18:06, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#72069] [Ruby trunk - Feature #11405] [PATCH] hash.c: minor speedups to int/fixnum keys — mame@...
Issue #11405 has been updated by Yusuke Endoh.
[#72115] Re: [ruby-cvs:60264] duerst:r53112 (trunk): * enc/ebcdic.h: new dummy encoding EBCDIC-US — "U.NAKAMURA" <usa@...>
Hi,
On 2015/12/14 22:34, U.NAKAMURA wrote:
Hi,
[ruby-core:72347] [Ruby trunk - Feature #11786] [Open] [PATCH] micro-optimize case dispatch even harder
Joseph Jones liked your message with Boxer. On December 7, 2015 at 20:36:29 MST, normalperson@yhbt.net wrote:Issue #11786 has been reported by Eric Wong.----------------------------------------Feature #11786: [PATCH] micro-optimize case dispatch even harderhttps://bugs.ruby-lang.org/issues/11786* Author: Eric Wong* Status: Open* Priority: Normal* Assignee: ----------------------------------------I noticed these optimizations while working on r52931.By using a bare hash table, we avoid the overhead of rb_hash_*functions as well as the cost of translating FIX2INT for jumplabels.This also reduces GC overhead, as the iseq mark array no longercarries redundant objects nor the Hash object.Summary speedup:loop_whileloop2 1.000vm2_case* 1.225vm2_case_lit* 1.000vm2_case_small* 1.162Passes all tests and specs, so probably safe to commit soon...Full results:2015-12-08 03:26:19 +0000target 0: a (ruby 2.3.0dev (2015-12-08 trunk 52932) [x86_64-linux]) at "/home/ew/rrrr/b/ruby"target 1: b (ruby 2.3.0dev (2015-12-08 master 52932) [x86_64-linux]last_commit=micro-optimize case dispatch even harder) at "/home/ew/ruby/b/ruby"-----------------------------------------------------------loop_whileloop2i = 0while i i += 1enda 0.10256672604009509a 0.10279557690955698a 0.10286601004190743a 0.10278227413073182a 0.10278794192709029b 0.10288732498884201b 0.10327051300555468b 0.1026718900538981b 0.10263488302007318b 0.10256404406391084-----------------------------------------------------------vm2_casei = 0while i case :foo when :bar raise when :baz raise when :boo raise when :foo i += 1 endenda 0.18099936190992594a 0.1836838680319488a 0.1825075231026858a 0.18087006197310984a 0.18375545786693692b 0.16652655508369207b 0.16673082998022437b 0.16754083498381078b 0.16704767406918108b 0.16648077592253685-----------------------------------------------------------vm2_case_liti = 0@ret = [ "foo", true, false, :sym, 6, nil, 0.1, 0xffffffffffffffff ]def foo(i) @ret[i % @ret.size]endwhile i case foo(i) when "foo" then :foo when true then true when false then false when :sym then :sym when 6 then :fix when nil then nil when 0.1 then :float when 0xffffffffffffffff then :big end i += 1enda 0.670805990928784a 0.6559841448906809a 0.6560367799829692a 0.655022048857063a 0.671947613125667b 0.659776204964146b 0.6549702121410519b 0.6788892599288374b 0.6793588208965957b 0.6878500080201775-----------------------------------------------------------vm2_case_smalli = 0while i case :foo when :foo i += 1 else raise endenda 0.1667630800511688a 0.16669297800399363a 0.1665362489875406a 0.16644068900495768a 0.16646360605955124b 0.15790433110669255b 0.15774213010445237b 0.15753646893426776b 0.15781028987839818b 0.15771835204213858Elapsed time: 11.069307098 (sec)-----------------------------------------------------------benchmark results:minimum results in each 5 measurements.Execution time (sec)name a bloop_whileloop2 0.103 0.103vm2_case* 0.078 0.064vm2_case_lit* 0.552 0.552vm2_case_small* 0.064 0.055---Files--------------------------------0001-micro-optimize-case-dispatch-even-harder.patch (9.34 KB)-- https://bugs.ruby-lang.org/