From a47f598d77ac97f9fe89fe16aa8bcab4fd262c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lourens=20Naud=C3=A9?= Date: Sat, 20 Apr 2019 00:44:51 +0100 Subject: Reduce ONIG_NREGION from 10 to 4: power of 2 and testing revealed most pattern matches are less than or equal to 4 results Closes: https://github.com/ruby/ruby/pull/2135 --- benchmark/match_gt4.rb | 1 + benchmark/match_small.rb | 1 + 2 files changed, 2 insertions(+) create mode 100644 benchmark/match_gt4.rb create mode 100644 benchmark/match_small.rb (limited to 'benchmark') diff --git a/benchmark/match_gt4.rb b/benchmark/match_gt4.rb new file mode 100644 index 0000000000..ffda109912 --- /dev/null +++ b/benchmark/match_gt4.rb @@ -0,0 +1 @@ +1000000.times { /(.)(.)(\d+)(\d)/.match("THX1138.") } diff --git a/benchmark/match_small.rb b/benchmark/match_small.rb new file mode 100644 index 0000000000..3b743d484a --- /dev/null +++ b/benchmark/match_small.rb @@ -0,0 +1 @@ +1000000.times { 'haystack'.match(/hay/) } -- cgit v1.2.3