[#99868] [Ruby master Bug#17144] Tempfile.open { ... } does not unlink the file — eregontp@...
Issue #17144 has been reported by Eregon (Benoit Daloze).
15 messages
2020/09/03
[ruby-core:100127] [Ruby master Bug#17030] Enumerable#grep{_v} should be optimized for Regexp
From:
matz@...
Date:
2020-09-25 06:53:54 UTC
List:
ruby-core #100127
Issue #17030 has been updated by matz (Yukihiro Matsumoto).
As far as we measured, there are still plenty of room for the optimization (for example, we don't need to allocate `MatchObject` for `grep_v`). We will investigate to improve the performance for those methods.
Besides that, `/f` flag for regexp may be a useful idea (though little ugly). Could you resubmit the independent issue for the feature, if you like.
Matz.
----------------------------------------
Bug #17030: Enumerable#grep{_v} should be optimized for Regexp
https://bugs.ruby-lang.org/issues/17030#change-87696
* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Currently,
```ruby
array.select { |e| e.match?(REGEXP) }
```
is about three times faster and six times more memory efficient than
```ruby
array.grep(REGEXP)
```
This is because `grep` calls `Regexp#===`, which creates useless `MatchData`.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>