Skip to content

Commit 920ccb5

Browse files
committed
[GR-17601] Enable Truffle Regex by default
1 parent 4fff15f commit 920ccb5

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
New features:
44

5+
* [TRegex](https://github.com/oracle/graal/tree/master/regex) is now used by default, which provides large speedups for matching regular expressions.
56

67
Bug fixes:
78

src/main/java/org/truffleruby/options/Options.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public class Options {
129129
public final boolean WARN_DEPRECATED;
130130
/** --warn-experimental=true */
131131
public final boolean WARN_EXPERIMENTAL;
132-
/** --use-truffle-regex=false */
132+
/** --use-truffle-regex=true */
133133
public final boolean USE_TRUFFLE_REGEX;
134134
/** --warn-truffle-regex-compile-fallback=false */
135135
public final boolean WARN_TRUFFLE_REGEX_COMPILE_FALLBACK;

src/options.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ EXPERT:
146146
WARN_EXPERIMENTAL: [[warn-experimental, -W], boolean, true, 'Sets experimental Warning category']
147147

148148
# Controlling the regular expression engines
149-
USE_TRUFFLE_REGEX: [use-truffle-regex, boolean, false, 'Use the Truffle regular expression engine for Regexp objects']
149+
USE_TRUFFLE_REGEX: [use-truffle-regex, boolean, true, 'Use the Truffle regular expression engine when possible and fallback to Joni otherwise']
150150
WARN_TRUFFLE_REGEX_COMPILE_FALLBACK: [warn-truffle-regex-compile-fallback, boolean, false, 'Warn when a Ruby Regexp could not be compiled to a Truffle Regex and Joni is used instead']
151151
WARN_TRUFFLE_REGEX_MATCH_FALLBACK: [warn-truffle-regex-match-fallback, boolean, false, 'Warn every time Truffle Regex cannot be used for a Regexp match (and instead Joni is used)']
152152

src/shared/java/org/truffleruby/shared/options/OptionsCatalog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class OptionsCatalog {
8383
public static final OptionKey<Boolean> CEXTS_LOG_WARNINGS_KEY = new OptionKey<>(false);
8484
public static final OptionKey<Boolean> WARN_DEPRECATED_KEY = new OptionKey<>(false);
8585
public static final OptionKey<Boolean> WARN_EXPERIMENTAL_KEY = new OptionKey<>(true);
86-
public static final OptionKey<Boolean> USE_TRUFFLE_REGEX_KEY = new OptionKey<>(false);
86+
public static final OptionKey<Boolean> USE_TRUFFLE_REGEX_KEY = new OptionKey<>(true);
8787
public static final OptionKey<Boolean> WARN_TRUFFLE_REGEX_COMPILE_FALLBACK_KEY = new OptionKey<>(false);
8888
public static final OptionKey<Boolean> WARN_TRUFFLE_REGEX_MATCH_FALLBACK_KEY = new OptionKey<>(false);
8989
public static final OptionKey<Boolean> ARGV_GLOBALS_KEY = new OptionKey<>(false);
@@ -604,7 +604,7 @@ public class OptionsCatalog {
604604

605605
public static final OptionDescriptor USE_TRUFFLE_REGEX = OptionDescriptor
606606
.newBuilder(USE_TRUFFLE_REGEX_KEY, "ruby.use-truffle-regex")
607-
.help("Use the Truffle regular expression engine for Regexp objects")
607+
.help("Use the Truffle regular expression engine when possible and fallback to Joni otherwise")
608608
.category(OptionCategory.EXPERT)
609609
.stability(OptionStability.EXPERIMENTAL)
610610
.build();

0 commit comments

Comments
 (0)