Project

General

Profile

Bug #17030

Updated by sawa (Tsuyoshi Sawada) 6 months ago

Currently, Currently: 

 ```ruby 
 array.select { |e| e.match?(REGEXP) } 
 ``` 

 is # about three times 3x faster and six times 6x more memory efficient than 

 ```ruby 
 array.grep(REGEXP) 
 ``` 

 This is because `grep` calls `Regexp#===`, `Regexp#===` which creates useless `MatchData`. `MatchData`

Back