From: nobu@... Date: 2016-05-20T12:47:07+00:00 Subject: [ruby-core:75640] [Ruby trunk Feature#12403] Optimise Regexp#match? Issue #12403 has been updated by Nobuyoshi Nakada. https://github.com/ruby/ruby/compare/trunk...nobu:feature/12403-optimize-Regexp%23match_p ----------------------------------------------------------- benchmark results: Execution time (sec) name |normal |opt ----------------------------|------:|------: regexp_match_p_match_empty | 0.141| 0.111 regexp_match_p_match_long | 3.941| 3.864 regexp_match_p_match_short | 0.138| 0.099 regexp_match_p_unmatch_long | 3.848| 3.837 regexp_match_p_unmatch_short| 0.103| 0.079 Speedup ratio: compare with the result of `normal' (greater is better) name |opt ----------------------------|------: regexp_match_p_match_empty | 1.266 regexp_match_p_match_long | 1.020 regexp_match_p_match_short | 1.388 regexp_match_p_unmatch_long | 1.003 regexp_match_p_unmatch_short| 1.306 ---------------------------------------- Feature #12403: Optimise Regexp#match? https://bugs.ruby-lang.org/issues/12403#change-58771 * Author: Sam Saffron * Status: Open * Priority: Normal * Assignee: ---------------------------------------- At the moment `#match?` is dynamically dispatched and args are walked. Instead - Add 2 insns instructions for #match? with 1 param and #match? with 2 params - Amend parser to route #match?("s") and #match?("s", 1) to insns version Main reason for `#match?` is performance, might as well make it as fast as possible. -- https://bugs.ruby-lang.org/ Unsubscribe: