Project

General

Profile

Actions

Bug #1301

closed

Poor RegExp Matching Performance

Added by neo237 (Andreas Grau) over 15 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
1.9.0 (2008-06-20 revision 17482) [i486-linux]
Backport:
[ruby-core:22927]

Description

=begin
I noticed a very poor performance on matching regular expressions.

Running following code using ruby 1.9.0 on a Core2Duo (2x2Ghz) takes more than 20s to complete.

regexp = /[b]+.+.+.+.+.+.+.+.+[a]/
str="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
regexp.match(str)

$ time ruby1.9 test.rb

real 0m23.029s
user 0m22.421s
sys 0m0.012s
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0