| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
|
|
|
|
|
|
|
|
|
|
|
| |
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]
A test is quoted from https://github.com/ruby/ruby/pull/3817
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the following methods to return Array instances instead
of subclass instances:
* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*
Fixes [Bug #6087]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len
* Use rb_range_values to check Range object
* Fix ary_make_partial_step
* Fix for negative step cases
* range.c: Describe the role of err argument in rb_range_component_beg_len
* Raise a RangeError when an arithmetic sequence refers the outside of an array
[Feature #16812]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
any?
all?
one?
none?
sum
shuffle!
shuffle
sample
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
count
flatten!
flatten
cycle
permutation
combination
repeated_permutation
repeated_combination
product
take
take_while
drop
drop_while
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
&
intersection
|
union
max
min
minmax
uniq!
uniq
compact!
compact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
+
concat
*
assoc
rassoc
==
eql?
hash
include?
<=>
-
difference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
delete_at
slice!
reject!
reject
delete_if
zip
transpose
replace
clear
fill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
bsearch
bsearch_index
sort_by!
collect
collect!
values_at
select
select!
keep_if
delete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
length
empty?
join
inspect
to_a
to_h
to_ary
reverse!
reverse
rotate!
rotate
sort!
sort
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods considered:
at
first
last
fetch
index
rindex
[]
insert
each
each_index
reverse_each
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
- freeze
- try_convert
- new
- \<<
- push
- pop
- shift
- unshift
- []
|
|
|
| |
Further compliance with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc#details-and-examples-
|
|
|
| |
"Trivial" typically means "returns a new empty Array."
|
| |
|
|
|
| |
Removes references to *-convertible thingies.
|
|
|
|
|
|
| |
RARRAY_AREF has been a macro for reasons. We might not be able to
change that for public APIs, but why not relax the situation internally
to make it an inline function.
|
|
|
|
|
| |
* Fix links to Dig Methods document
* Fix links to Dig Methods document
|
|
|
|
|
|
|
| |
Adds a full discussion of #dig, along with links from Array, Hash, Struct, and OpenStruct.
CSV::Table and CSV::Row are over in ruby/csv. I'll get to them soon.
The art to the thing is to figure out how much (or how little) to say at each #dig.
|
|
|
|
| |
This reverts commit c355fa72d4e356378a8b03a67432b52bafcc308b.
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
drop
drop_while
any?
all?
none?
one?
|
| |
|
|
|
|
| |
Calls with a constant argument should be optimized away.
|
| |
|
| |
|
|
|
|
|
| |
* Enhanced documentation for Array#repeated_combination
* Enhanced documentation for Array#repeated_combination
|
|
|
|
|
| |
* Enhanced documentation for Array#repeated_permutation
* Enhanced documentation for Array#repeated_permutation
|
| |
|
| |
|
|
|
|
| |
Fixes [Bug #10475]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Enhanced RDoc for Array
Methods:
==
eql?
hash
include?
<=>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The benchmark result is below:
| |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.min | 39.105M| 39.442M|
| | -| 1.01x|
|ary10.min | 23.995M| 30.762M|
| | -| 1.28x|
|ary100.min | 6.249M| 10.783M|
| | -| 1.73x|
|ary500.min | 1.408M| 2.714M|
| | -| 1.93x|
|ary1000.min | 828.397k| 1.465M|
| | -| 1.77x|
|ary2000.min | 332.256k| 570.504k|
| | -| 1.72x|
|ary3000.min | 338.079k| 573.868k|
| | -| 1.70x|
|ary5000.min | 168.217k| 286.114k|
| | -| 1.70x|
|ary10000.min | 85.512k| 143.551k|
| | -| 1.68x|
|ary20000.min | 43.264k| 71.935k|
| | -| 1.66x|
|ary50000.min | 17.317k| 29.107k|
| | -| 1.68x|
|ary100000.min | 9.072k| 14.540k|
| | -| 1.60x|
|ary1000000.min | 872.930| 1.436k|
| | -| 1.64x|
compare-ruby is 9f4b7fc82e.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The benchmark result is below:
| |compare-ruby|built-ruby|
|:---------------|-----------:|---------:|
|ary2.max | 38.837M| 40.830M|
| | -| 1.05x|
|ary10.max | 23.035M| 32.626M|
| | -| 1.42x|
|ary100.max | 5.490M| 11.020M|
| | -| 2.01x|
|ary500.max | 1.324M| 2.679M|
| | -| 2.02x|
|ary1000.max | 699.167k| 1.403M|
| | -| 2.01x|
|ary2000.max | 284.321k| 570.446k|
| | -| 2.01x|
|ary3000.max | 282.613k| 571.683k|
| | -| 2.02x|
|ary5000.max | 145.120k| 285.546k|
| | -| 1.97x|
|ary10000.max | 72.102k| 142.831k|
| | -| 1.98x|
|ary20000.max | 36.065k| 72.077k|
| | -| 2.00x|
|ary50000.max | 14.343k| 29.139k|
| | -| 2.03x|
|ary100000.max | 7.586k| 14.472k|
| | -| 1.91x|
|ary1000000.max | 726.915| 1.495k|
| | -| 2.06x|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Enhanced RDoc for Array#fill
* Update array.c
There's one more at 5072. I'll get it.
Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Update array.c
Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Update array.c
Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Update array.c
Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Update array.c
Co-authored-by: Eric Hodel <drbrain@segment7.net>
* Update array.c
Co-authored-by: Eric Hodel <drbrain@segment7.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
reject!
reject
delete_if
zip
transpose
replace
clear
|
|
|
|
|
|
|
|
|
| |
*Methods:
keep_if
delete
delete_at
slice!
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|