<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/rubygems, branch v4.0.3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Merge RubyGems/Bundler 4.0.6</title>
<updated>2026-02-10T01:38:24+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-02-10T01:07:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e025c839ac71b609bb50ff74352f9a11cd164c3c'/>
<id>e025c839ac71b609bb50ff74352f9a11cd164c3c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge RubyGems/Bundler 4.0.5</title>
<updated>2026-02-10T01:38:24+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-02-10T01:07:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87b544b8c4400ef2b37405f132846e5c3738213b'/>
<id>87b544b8c4400ef2b37405f132846e5c3738213b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge RubyGems/Bundler 4.0.4</title>
<updated>2026-02-10T01:38:24+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-02-10T01:07:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=91a4926c9a9cd12f43307a2c934766c000356f07'/>
<id>91a4926c9a9cd12f43307a2c934766c000356f07</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge RubyGems 4.0.3 and Bundler 4.0.3</title>
<updated>2025-12-23T07:10:04+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-12-23T04:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1c3ef2719155b56f14bf734c82b26ef0bbaac798'/>
<id>1c3ef2719155b56f14bf734c82b26ef0bbaac798</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Bundle RubyGems 4.0.2 and Bundler 4.0.2</title>
<updated>2025-12-17T03:12:34+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-12-17T02:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3b66efda523fc33070aee6097898dbc5b1af6f4b'/>
<id>3b66efda523fc33070aee6097898dbc5b1af6f4b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Allow to specify the number of `make` jobs when installing gems:</title>
<updated>2025-12-16T04:21:49+00:00</updated>
<author>
<name>Edouard CHIN</name>
<email>chin.edouard@gmail.com</email>
</author>
<published>2025-12-10T13:29:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=080bf30c48a8212cf0ee4f769d1bdaa4a2df5900'/>
<id>080bf30c48a8212cf0ee4f769d1bdaa4a2df5900</id>
<content type='text'>
- Added a new `-j` option to `gem install` and `gem update`.
  This option allows to specify the number of jobs we pass to `make`
  when compiling gem with native extensions.

  By default its the number of processors, but users may want a way
  to control this.

  You can use it like so: `gem install json -j8`

https://github.com/ruby/rubygems/commit/67aad88ca6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Added a new `-j` option to `gem install` and `gem update`.
  This option allows to specify the number of jobs we pass to `make`
  when compiling gem with native extensions.

  By default its the number of processors, but users may want a way
  to control this.

  You can use it like so: `gem install json -j8`

https://github.com/ruby/rubygems/commit/67aad88ca6
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Pass down value of `BUNDLE_JOBS` to RubyGems before compiling:</title>
<updated>2025-12-16T04:21:49+00:00</updated>
<author>
<name>Edouard CHIN</name>
<email>chin.edouard@gmail.com</email>
</author>
<published>2025-12-08T21:02:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9f593156b6184718a65f99905e6b07002058ebe6'/>
<id>9f593156b6184718a65f99905e6b07002058ebe6</id>
<content type='text'>
- ### Problem

  Since https://github.com/ruby/rubygems/pull/9131, we are now
  compiling make rules simultaneously. The number of jobs
  is equal to the number of processors.
  This may be problematic for some users as they want to control
  this value.

  ### Solution

  The number of jobs passed to `make` will now be equal to the
  `BUNDLE_JOBS` value.

  ### Side note

  It's also worth to note that since Bundler installs gems in
  parallel, we may end up running multiple `make -j&lt;JOB&gt;` in parallel
  which would cause exhaust the number of processors we have.
  This problem can be fixed by implementing a GNU jobserver, which I
  plan to do. But I felt that this would be too much change in one PR.

https://github.com/ruby/rubygems/commit/d51995deb9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- ### Problem

  Since https://github.com/ruby/rubygems/pull/9131, we are now
  compiling make rules simultaneously. The number of jobs
  is equal to the number of processors.
  This may be problematic for some users as they want to control
  this value.

  ### Solution

  The number of jobs passed to `make` will now be equal to the
  `BUNDLE_JOBS` value.

  ### Side note

  It's also worth to note that since Bundler installs gems in
  parallel, we may end up running multiple `make -j&lt;JOB&gt;` in parallel
  which would cause exhaust the number of processors we have.
  This problem can be fixed by implementing a GNU jobserver, which I
  plan to do. But I felt that this would be too much change in one PR.

https://github.com/ruby/rubygems/commit/d51995deb9
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Write gem files atomically</title>
<updated>2025-12-15T01:15:06+00:00</updated>
<author>
<name>eileencodes</name>
<email>eileencodes@gmail.com</email>
</author>
<published>2025-11-25T19:17:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=58940377e6f27f39d5c3baa0faa15655fa873f2c'/>
<id>58940377e6f27f39d5c3baa0faa15655fa873f2c</id>
<content type='text'>
This change updates `write_binary` to use a new class,
`AtomicFileWriter.open` to write the gem's files. This implementation
is borrowed from Active Support's [`atomic_write`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/file/atomic.rb).

Atomic write will write the files to a temporary file and then once
created, sets permissions and renames the file. If the file is corrupted
- ie on failed download, an error occurs, or for some other reason, the
real file will not be created. The changes made here make `verify_gz`
obsolete, we don't need to verify it if we have successfully created the
file atomically. If it exists, it is not corrupt. If it is corrupt, the
file won't exist on disk.

While writing tests for this functionality I replaced the
`RemoteFetcher` stub with `FakeFetcher` except for where we really do
need to overwrite the `RemoteFetcher`. The new test implementation is much
clearer on what it's trying to accomplish versus the prior test
implementation.

https://github.com/ruby/rubygems/commit/0cd4b54291
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change updates `write_binary` to use a new class,
`AtomicFileWriter.open` to write the gem's files. This implementation
is borrowed from Active Support's [`atomic_write`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/file/atomic.rb).

Atomic write will write the files to a temporary file and then once
created, sets permissions and renames the file. If the file is corrupted
- ie on failed download, an error occurs, or for some other reason, the
real file will not be created. The changes made here make `verify_gz`
obsolete, we don't need to verify it if we have successfully created the
file atomically. If it exists, it is not corrupt. If it is corrupt, the
file won't exist on disk.

While writing tests for this functionality I replaced the
`RemoteFetcher` stub with `FakeFetcher` except for where we really do
need to overwrite the `RemoteFetcher`. The new test implementation is much
clearer on what it's trying to accomplish versus the prior test
implementation.

https://github.com/ruby/rubygems/commit/0cd4b54291
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Extract and generate only bundler bin files instead of full installation.</title>
<updated>2025-12-08T23:52:15+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-12-08T06:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca8630b6363a706a43bfdb5a3359addcfb616d19'/>
<id>ca8630b6363a706a43bfdb5a3359addcfb616d19</id>
<content type='text'>
https://github.com/ruby/rubygems/commit/a70e573973
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/rubygems/commit/a70e573973
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/rubygems] Increase connection pool to allow for up to 70% speed increase:</title>
<updated>2025-12-04T06:47:46+00:00</updated>
<author>
<name>Edouard CHIN</name>
<email>chin.edouard@gmail.com</email>
</author>
<published>2025-11-16T23:18:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=932762f29457ad1def6fbab7eca7bcbeeb58ea5c'/>
<id>932762f29457ad1def6fbab7eca7bcbeeb58ea5c</id>
<content type='text'>
- ### TL;DR

  Bundler is heavily limited by the connection pool which manages a
  single connection. By increasing the number of connection, we can
  drastiscally speed up the installation process when many gems need
  to be downloaded and installed.

  ### Benchmark

  There are various factors that are hard to control such as
  compilation time and network speed but after dozens of tests I
  can consistently get aroud 70% speed increase when downloading and
  installing 472 gems, most having no native extensions (on purpose).

  ```
  # Before
  bundle install  28.60s user 12.70s system 179% cpu 23.014 total

  # After
  bundle install  30.09s user 15.90s system 281% cpu 16.317 total
  ```

  You can find on this gist how this was benchmarked and the Gemfile
  used https://gist.github.com/Edouard-chin/c8e39148c0cdf324dae827716fbe24a0

  ### Context

  A while ago in #869, Aaron introduced a connection pool which
  greatly improved Bundler speed. It was noted in the PR description
  that managing one connection was already good enough and it wasn't
  clear whether we needed more connections. Aaron also had the
  intuition that we may need to increase the pool for downloading
  gems and he was right.

  &gt; We need to study how RubyGems uses connections and make a decision
  &gt; based on request usage (e.g. only use one connection for many small
  &gt; requests like bundler API, and maybe many connections for
  &gt; downloading gems)

  When bundler downloads and installs gem in parallel https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/installer/parallel_installer.rb#L128
  most threads have to wait for the only connection in the pool to be
  available which is not efficient.

  ### Solution

  This commit modifies the pool size for the fetcher that Bundler
  uses. RubyGems fetcher will continue to use a single connection.

  The bundler fetcher is used in 2 places.

  1. When downloading gems https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/source/rubygems.rb#L481-L484
  2. When grabing the index (not the compact index) using the
    `bundle install --full-index` flag.
    https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/fetcher/index.rb#L9

  Having more connections in 2) is not any useful but tweaking the
  size based on where the fetcher is used is a bit tricky so I opted
  to modify it at the class level.
  I fiddle with the pool size and found that 5 seems to be the sweet
  spot at least for my environment.

https://github.com/ruby/rubygems/commit/6063fd9963
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- ### TL;DR

  Bundler is heavily limited by the connection pool which manages a
  single connection. By increasing the number of connection, we can
  drastiscally speed up the installation process when many gems need
  to be downloaded and installed.

  ### Benchmark

  There are various factors that are hard to control such as
  compilation time and network speed but after dozens of tests I
  can consistently get aroud 70% speed increase when downloading and
  installing 472 gems, most having no native extensions (on purpose).

  ```
  # Before
  bundle install  28.60s user 12.70s system 179% cpu 23.014 total

  # After
  bundle install  30.09s user 15.90s system 281% cpu 16.317 total
  ```

  You can find on this gist how this was benchmarked and the Gemfile
  used https://gist.github.com/Edouard-chin/c8e39148c0cdf324dae827716fbe24a0

  ### Context

  A while ago in #869, Aaron introduced a connection pool which
  greatly improved Bundler speed. It was noted in the PR description
  that managing one connection was already good enough and it wasn't
  clear whether we needed more connections. Aaron also had the
  intuition that we may need to increase the pool for downloading
  gems and he was right.

  &gt; We need to study how RubyGems uses connections and make a decision
  &gt; based on request usage (e.g. only use one connection for many small
  &gt; requests like bundler API, and maybe many connections for
  &gt; downloading gems)

  When bundler downloads and installs gem in parallel https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/installer/parallel_installer.rb#L128
  most threads have to wait for the only connection in the pool to be
  available which is not efficient.

  ### Solution

  This commit modifies the pool size for the fetcher that Bundler
  uses. RubyGems fetcher will continue to use a single connection.

  The bundler fetcher is used in 2 places.

  1. When downloading gems https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/source/rubygems.rb#L481-L484
  2. When grabing the index (not the compact index) using the
    `bundle install --full-index` flag.
    https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/fetcher/index.rb#L9

  Having more connections in 2) is not any useful but tweaking the
  size based on where the fetcher is used is a bit tricky so I opted
  to modify it at the class level.
  I fiddle with the pool size and found that 5 seems to be the sweet
  spot at least for my environment.

https://github.com/ruby/rubygems/commit/6063fd9963
</pre>
</div>
</content>
</entry>
</feed>
