Project

General

Profile

Feature #12403

Optimise Regexp#match?

Added by sam.saffron (Sam Saffron) over 4 years ago. Updated over 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:75628]

Description

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.


Related issues

Related to Ruby master - Feature #12306: Implement String #blank? #present? and improve #strip and family to handle unicodeOpenmatz (Yukihiro Matsumoto)Actions

Also available in: Atom PDF