summaryrefslogtreecommitdiff
path: root/array.rb
AgeCommit message (Collapse)Author
2025-01-03[DOC] Tweaks for Array docBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/12498
2024-12-17[DOC] Change arg names from n to count (#12288)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-12-13[DOC] Improve array.rb documentation (#12340)Alex Rocha
* Fix grammar errors, typos, and improve readability of array.rb * [DOC] Remove an extra space --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-12-13[DOC] Fix incorrect `Array#fetch_values` examples (#12337)Kouhei Yanagita
[DOC] Fix incorrect Array#fetch_values examples Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-11-13Move Array#map to RubyTakashi Kokubun
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/12074
2024-11-13Move Array#select to RubyTakashi Kokubun
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/12074
2024-11-04YJIT: Replace Array#each only when YJIT is enabled (#11955)Takashi Kokubun
* YJIT: Replace Array#each only when YJIT is enabled * Add comments about BUILTIN_ATTR_C_TRACE * Make Ruby Array#each available with --yjit as well * Fix all paths that expect a C location * Use method_basic_definition_p to detect patches * Copy a comment about C_TRACE flag to compilers * Rephrase a comment about add_yjit_hook * Give METHOD_ENTRY_BASIC flag to Array#each * Add --yjit-c-builtin option * Allow inconsistent source_location in test-spec * Refactor a check of BUILTIN_ATTR_C_TRACE * Set METHOD_ENTRY_BASIC without touching vm->running Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-16[DOC] Tweaks for Array#shuffleBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11899
2024-10-16[DOC] Correct related for Array#shuffle!BurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11900
2024-10-15[DOC] Tweaks for Array#shuffle! (#11891)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-10-11[DOC] Tweaks for Array#sample (#11876)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-10-02[DOC] Tweaks for Array#last (#11748)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-09-29[DOC] Tweaks for Array#first (#11687)Burdette Lamar
2024-09-12[DOC] Tweaks for Array#fetch_values (#11603)Burdette Lamar
Notes: Merged-By: peterzhu2118 <peter@peterzhu.ca>
2024-09-11[DOC] Tweaks for Array#eachBurdetteLamar
Notes: Merged: https://github.com/ruby/ruby/pull/11597
2024-09-06Implement Array#fetch_valuesJean Boussier
[Feature #20702] Works the same way than `Hash#fetch_values` for for array. Notes: Merged: https://github.com/ruby/ruby/pull/11557
2024-07-29Revert moving things to RubyAaron Patterson
This is slowing down benchmarks on x86, so lets revert it for now. Notes: Merged: https://github.com/ruby/ruby/pull/11275
2024-07-19Remove redundant :use_block with yield (#11203)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2024-07-03Move Array#map to RubyAaron Patterson
Improves activerecord by about 1% on the interpreter: ``` before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) [arm64-darwin23] after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) [arm64-darwin23] ------------ ----------- ---------- ---------- ---------- ------------- ------------ bench before (ms) stddev (%) after (ms) stddev (%) after 1st itr before/after activerecord 235.2 0.8 233.6 0.7 1.01 1.01 ------------ ----------- ---------- ---------- ---------- ------------- ------------ Legend: - after 1st itr: ratio of before/after time for the first benchmarking iteration. - before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup. ``` Improves YJIT by about 4%: ``` before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) +YJIT [arm64-darwin23] after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) +YJIT [arm64-darwin23] ------------ ----------- ---------- ---------- ---------- ------------- ------------ bench before (ms) stddev (%) after (ms) stddev (%) after 1st itr before/after activerecord 142.1 1.2 137.0 0.6 1.00 1.04 ------------ ----------- ---------- ---------- ---------- ------------- ------------ Legend: - after 1st itr: ratio of before/after time for the first benchmarking iteration. - before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup. ```
2024-07-03Move Array#select to RubyAaron Patterson
This speeds up the mail benchmark by about 7% on the interpreter: ``` before: ruby 3.4.0dev (2024-07-03T17:01:41Z master f4b313f733) [arm64-darwin23] after: ruby 3.4.0dev (2024-07-03T17:45:50Z ruby-select de282cacd5) [arm64-darwin23] ----- ----------- ---------- ---------- ---------- ------------- ------------ bench before (ms) stddev (%) after (ms) stddev (%) after 1st itr before/after mail 72.9 0.8 68.2 1.0 1.02 1.07 ----- ----------- ---------- ---------- ---------- ------------- ------------ Legend: - after 1st itr: ratio of before/after time for the first benchmarking iteration. - before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup. ``` YJIT is about 13% faster: ``` before: ruby 3.4.0dev (2024-07-03T17:01:41Z master f4b313f733) +YJIT [arm64-darwin23] after: ruby 3.4.0dev (2024-07-03T17:45:50Z ruby-select de282cacd5) +YJIT [arm64-darwin23] ----- ----------- ---------- ---------- ---------- ------------- ------------ bench before (ms) stddev (%) after (ms) stddev (%) after 1st itr before/after mail 51.0 0.8 45.2 0.6 1.00 1.13 ----- ----------- ---------- ---------- ---------- ------------- ------------ Legend: - after 1st itr: ratio of before/after time for the first benchmarking iteration. - before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup. ```
2024-04-15show warning for unused blockKoichi Sasada
With verbopse mode (-w), the interpreter shows a warning if a block is passed to a method which does not use the given block. Warning on: * the invoked method is written in C * the invoked method is not `initialize` * not invoked with `super` * the first time on the call-site with the invoked method (`obj.foo{}` will be warned once if `foo` is same method) [Feature #15554] `Primitive.attr! :use_block` is introduced to declare that primitive functions (written in C) will use passed block. For minitest, test needs some tweak, so use https://github.com/minitest/minitest/commit/ea9caafc0754b1d6236a490d59e624b53209734a for `test-bundled-gems`.
2024-02-17Use `defined?(yield)` and `SIZED_ENUMERATOR`Nobuyoshi Nakada
Prefer built-in features over method calls that may be overridden.
2024-02-14[DOC] Doc compliance (#9955)Burdette Lamar
2024-01-23Rewrite Array#each in Ruby using Primitive (#9533)Takashi Kokubun
2023-08-15[DOC] Improve doc guide compliance (#8221)Burdette Lamar
2023-05-10[DOC] Move docs of `Array#first` and `Array#last` to array.rbNobuyoshi Nakada
2023-03-23`Array#first` and `Array#last` in RubyKoichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/7486
2021-11-15Use `Primitive.mandatory_only?` for `Array#sample`Koichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/5112
2021-09-22[DOC] Additional to Array#sample [ci skip]Nobuyoshi Nakada
* The requirement to the +n+ argument. * The order of the result array. [Misc #14147]
2020-11-12array.rb: Remove unnecessary phrase from rdocYusuke Endoh
A fix to 54fb8fb62a30c7b60ab6443a62821f6f8bc479c4
2020-11-12array.rb: show examples whether `Array#shuffle!` has side effect or notYusuke Endoh
Partially revert 54fb8fb62a30c7b60ab6443a62821f6f8bc479c4
2020-09-02Comply with guide for method doc: array.c (#3506)Burdette Lamar
Methods: any? all? one? none? sum shuffle! shuffle sample Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
2020-06-19[Feature #16254] Use `Primitive.func` styleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3165
2020-06-19[Feature #16254] Use `__builtin.func` styleNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3165
2020-02-01Removed useless shebang and executable bit [ci skip]Nobuyoshi Nakada
2020-01-27Cleaned an excess semicolon up [ci skip]Nobuyoshi Nakada
which has not been removed when translated from C.
2020-01-26Moved Array#sample to rbincNobuyoshi Nakada
2020-01-26Moved Array#shuffle and Array#shuffle! to rbincNobuyoshi Nakada
close