diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2022-03-24 01:57:34 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2022-03-24 09:47:22 +0900 |
commit | 9112cf4ae7f7ea8ab33c282aa02eec812421aeab (patch) | |
tree | 1ccef0a305de038f6d5e3c2cffe85d809f958fdf /regexec.c | |
parent | 1357b14750275d2f2d13896688064e1a243007dd (diff) |
regint.h: Reduce the frequency of rb_thread_check_ints
edc8576a65b7082597d45a694434261ec3ac0d9e checks interrupt at every
backtrack, which brought significant overhead.
This change makes the check only once every 128 backtracks.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5697
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -421,6 +421,7 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from) (msa).start = (arg_start);\ (msa).gpos = (arg_gpos);\ (msa).best_len = ONIG_MISMATCH;\ + (msa).counter = 0;\ } while(0) #else # define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos) do {\ @@ -429,6 +430,7 @@ onig_region_copy(OnigRegion* to, const OnigRegion* from) (msa).region = (arg_region);\ (msa).start = (arg_start);\ (msa).gpos = (arg_gpos);\ + (msa).counter = 0;\ } while(0) #endif |