<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/array.c, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Small documentation adjustments for new/updated features (#15634)</title>
<updated>2025-12-20T11:07:38+00:00</updated>
<author>
<name>Victor Shepelev</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2025-12-20T11:07:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ec4ca91319212ac9109ceac305f527c998da1738'/>
<id>ec4ca91319212ac9109ceac305f527c998da1738</id>
<content type='text'>
* Document Range#to_set

* Update Thread#raise and Fiber#raise signatures and docs

* Add reference to String#strip to character_selectors.rdoc

* Update *nil docs when calling methods

* Enhance Array#find and #rfind docs

* Add a notice to Kernel#raise about cause:</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Document Range#to_set

* Update Thread#raise and Fiber#raise signatures and docs

* Add reference to String#strip to character_selectors.rdoc

* Update *nil docs when calling methods

* Enhance Array#find and #rfind docs

* Add a notice to Kernel#raise about cause:</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Use Arrays in examples for Array#find</title>
<updated>2025-12-18T05:22:39+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-12-15T13:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=769c6a1c54e68d0100054e51fc25e1a6355645c8'/>
<id>769c6a1c54e68d0100054e51fc25e1a6355645c8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Define Array#detect as an alias for Array#find</title>
<updated>2025-12-15T15:52:43+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-12-15T13:36:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bb0e42c5e706f238dce40abb9cf5322e4a8a73cb'/>
<id>bb0e42c5e706f238dce40abb9cf5322e4a8a73cb</id>
<content type='text'>
Otherwise Array#detect is Enumerable#detect while Array#find uses a
different more performant implementation.

[Feature #21678]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise Array#detect is Enumerable#detect while Array#find uses a
different more performant implementation.

[Feature #21678]
</pre>
</div>
</content>
</entry>
<entry>
<title>Array#rfind</title>
<updated>2025-12-12T18:35:30+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2025-11-14T16:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6147b695870ce82ee3ad5305ce095b63889b8d9d'/>
<id>6147b695870ce82ee3ad5305ce095b63889b8d9d</id>
<content type='text'>
Implement Array#rfind, which is the same as find except from the
other side of the Array. Also implemented Array#find (as opposed to
the generic one on Enumerable because it is significantly faster
and to keep the implementations together.

[Feature #21678]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement Array#rfind, which is the same as find except from the
other side of the Array. Also implemented Array#find (as opposed to
the generic one on Enumerable because it is significantly faster
and to keep the implementations together.

[Feature #21678]
</pre>
</div>
</content>
</entry>
<entry>
<title>Cache array length in `rb_ary_join` (#15362)</title>
<updated>2025-12-02T22:35:53+00:00</updated>
<author>
<name>Luke Gruber</name>
<email>luke.gruber@shopify.com</email>
</author>
<published>2025-12-02T22:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a211abbcbd87f6d59a99cfcf2cb63a39d61b16ea'/>
<id>a211abbcbd87f6d59a99cfcf2cb63a39d61b16ea</id>
<content type='text'>
When all elements are strings, we never have to recalculate the length
of the array because there are no conversion methods that are called, so
the length will never change. This speeds up the fast path by ~10%.

```ruby
a = ["1"*10, "2"*10, "3"*10, "4"*10, "5"*10] * 10
10_000_000.times do
  a.join
end
```

```
hyperfine --warmup 1 'ruby ../ruby2/test.rb' './exe/ruby ../ruby2/test.rb'
Benchmark 1: ruby ../ruby2/test.rb
  Time (mean ± σ):      3.779 s ±  0.053 s    [User: 3.754 s, System: 0.017 s]
  Range (min … max):    3.715 s …  3.874 s    10 runs

Benchmark 2: ./exe/ruby ../ruby2/test.rb
  Time (mean ± σ):      3.411 s ±  0.038 s    [User: 3.387 s, System: 0.017 s]
  Range (min … max):    3.360 s …  3.472 s    10 runs

Summary
  ./exe/ruby ../ruby2/test.rb ran
    1.11 ± 0.02 times faster than ruby ../ruby2/test.rb
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When all elements are strings, we never have to recalculate the length
of the array because there are no conversion methods that are called, so
the length will never change. This speeds up the fast path by ~10%.

```ruby
a = ["1"*10, "2"*10, "3"*10, "4"*10, "5"*10] * 10
10_000_000.times do
  a.join
end
```

```
hyperfine --warmup 1 'ruby ../ruby2/test.rb' './exe/ruby ../ruby2/test.rb'
Benchmark 1: ruby ../ruby2/test.rb
  Time (mean ± σ):      3.779 s ±  0.053 s    [User: 3.754 s, System: 0.017 s]
  Range (min … max):    3.715 s …  3.874 s    10 runs

Benchmark 2: ./exe/ruby ../ruby2/test.rb
  Time (mean ± σ):      3.411 s ±  0.038 s    [User: 3.387 s, System: 0.017 s]
  Range (min … max):    3.360 s …  3.472 s    10 runs

Summary
  ./exe/ruby ../ruby2/test.rb ran
    1.11 ± 0.02 times faster than ruby ../ruby2/test.rb
```</pre>
</div>
</content>
</entry>
<entry>
<title>Remove an excess semicolon in a macro</title>
<updated>2025-11-30T22:15:36+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-30T22:15:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f92ff9a86b4de5cd6e368be62077741aa40abc64'/>
<id>f92ff9a86b4de5cd6e368be62077741aa40abc64</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Reorganize page documentations (#15154)</title>
<updated>2025-11-27T20:12:24+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2025-11-27T20:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4cd6661e1853930c8002174c4ccd14f927fcd33b'/>
<id>4cd6661e1853930c8002174c4ccd14f927fcd33b</id>
<content type='text'>
Re-organize page docs</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Re-organize page docs</pre>
</div>
</content>
</entry>
<entry>
<title>Fix array allocation when slot size &lt; 40 bytes</title>
<updated>2025-11-02T14:17:17+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-11-01T14:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2380f69f6875709ee4c37095cea4e6163d9faac1'/>
<id>2380f69f6875709ee4c37095cea4e6163d9faac1</id>
<content type='text'>
We need to allocate at least sizeof(struct RArray) when the array is
embedded on garbage collectors that support slot sizes less than 40 bytes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to allocate at least sizeof(struct RArray) when the array is
embedded on garbage collectors that support slot sizes less than 40 bytes.
</pre>
</div>
</content>
</entry>
<entry>
<title>use `SET_SHAREABLE`</title>
<updated>2025-10-23T04:08:26+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-09-24T20:50:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bc00c4468e0054ca896d2b83d3020180915f64cf'/>
<id>bc00c4468e0054ca896d2b83d3020180915f64cf</id>
<content type='text'>
to adopt strict shareable rule.

* (basically) shareable objects only refer shareable objects
* (exception) shareable objects can refere unshareable objects
  but should not leak reference to unshareable objects to Ruby world
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to adopt strict shareable rule.

* (basically) shareable objects only refer shareable objects
* (exception) shareable objects can refere unshareable objects
  but should not leak reference to unshareable objects to Ruby world
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typo in comment in array#zip docs</title>
<updated>2025-10-07T22:54:34+00:00</updated>
<author>
<name>Ricardo Trindade</name>
<email>ricardo.trindade743@gmail.com</email>
</author>
<published>2025-10-07T19:40:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=42ba82424d908c290a4a34ced8853f0a403b734b'/>
<id>42ba82424d908c290a4a34ced8853f0a403b734b</id>
<content type='text'>
Duplicate the was found in the documentation</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Duplicate the was found in the documentation</pre>
</div>
</content>
</entry>
</feed>
