[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
Issue #17326 has been reported by jez (Jake Zimmerman).
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:100748] [Ruby master Feature#17311] Improve performance Array#deconstruct & Array#to_ary
From:
gamelinks007@...
Date:
2020-11-08 07:08:56 UTC
List:
ruby-core #100748
Issue #17311 has been reported by S_H_ (Shun Hiraoka).
----------------------------------------
Feature #17311: Improve performance Array#deconstruct & Array#to_ary
https://bugs.ruby-lang.org/issues/17311
* Author: S_H_ (Shun Hiraoka)
* Status: Open
* Priority: Normal
----------------------------------------
Improve performance `Array#deconstruct` & `Array#to_ary` with Ruby code.
like this.
```ruby
class Array
def deconstruct
return self
end
def to_ary
return self
end
end
```
benchmark:
```yml
prelude: |
sary = Array.new(10)
mary = Array.new(1000)
lary = Array.new(30_000_000)
benchmark:
- sary.deconstruct
- mary.deconstruct
- lary.deconstruct
- sary.to_ary
- mary.to_ary
- lary.to_ary
loop_count: 20000000
```
benchmark result:
```bash
sh@MyComputer:~/rubydev/build$ make benchmark/benchmark.yml -e COMPARE_RUBY=~/.rbenv/shims/ruby -e BENCH_RUBY=../install/bin/ruby
# Iteration per second (i/s)
| |compare-ruby|built-ruby|
|:-----------------|-----------:|---------:|
|sary.deconstruct | 72.866M| 74.310M|
| | -| 1.02x|
|mary.deconstruct | 73.665M| 80.049M|
| | -| 1.09x|
|lary.deconstruct | 74.924M| 86.865M|
| | -| 1.16x|
|sary.to_ary | 70.203M| 81.387M|
| | -| 1.16x|
|mary.to_ary | 72.142M| 78.847M|
| | -| 1.09x|
|lary.to_ary | 70.473M| 86.382M|
| | -| 1.23x|
```
COMPARE_RUBY is `ruby 3.0.0dev (2020-11-07T13:12:22Z master 5823f6c25b) [x86_64-linux]`. BENCH_RUBY is ahead of `ruby 3.0.0dev (2020-11-07T13:12:22Z master 5823f6c25b) [x86_64-linux]`.
Also expect to improve the performance of pattern matching using arrays.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>