ruby-core

Mailing list archive

[#119670] [Ruby master Feature#20859] Make Base64 to core class — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #20859 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2024/11/01

[#119683] [Ruby master Feature#20861] Add an environment variable for tuning the default thread quantum — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

Issue #20861 has been reported by tenderlovemaking (Aaron Patterson).

24 messages 2024/11/01

[#119724] [Ruby master Bug#20863] `zlib.c` calls `rb_str_set_len` and `rb_str_modify_expand`(and others) without holding the GVL. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20863 has been reported by ioquatix (Samuel Williams).

8 messages 2024/11/05

[#119726] [Ruby master Feature#20864] Support `error:` keyword to `Kernel#warn` — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20864 has been reported by ioquatix (Samuel Williams).

14 messages 2024/11/05

[#119741] [Ruby master Bug#20869] IO buffer handling is inconsistent when seeking — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20869 has been reported by javanthropus (Jeremy Bopp).

13 messages 2024/11/05

[#119751] [Ruby master Bug#20871] Including methods in Enumerable doesn't make them available in Array — "sanderd17 (Sander Deryckere) via ruby-core" <ruby-core@...>

Issue #20871 has been reported by sanderd17 (Sander Deryckere).

13 messages 2024/11/05

[#119769] [Ruby master Feature#20875] Atomic initialization for Ractor local storage — "ko1 (Koichi Sasada) via ruby-core" <ruby-core@...>

Issue #20875 has been reported by ko1 (Koichi Sasada).

12 messages 2024/11/06

[#119801] [Ruby master Feature#20878] A new C API to create a String by adopting a pointer: `rb_enc_str_adopt(const char *ptr, long len, long capa, rb_encoding *enc)` — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>

Issue #20878 has been reported by byroot (Jean Boussier).

32 messages 2024/11/07

[#119852] [Ruby master Feature#20882] Provide Boolean(...) — "getajobmike (Mike Perham) via ruby-core" <ruby-core@...>

Issue #20882 has been reported by getajobmike (Mike Perham).

12 messages 2024/11/08

[#119881] [Ruby master Feature#20884] reserve "Ruby" toplevel module for Ruby language — "Dan0042 (Daniel DeLorme) via ruby-core" <ruby-core@...>

Issue #20884 has been reported by Dan0042 (Daniel DeLorme).

8 messages 2024/11/12

[#119897] [Ruby master Bug#20890] MacOS 15.1, Macbook pro 2024 m4, YJIT: Kernel Panic on network access, works w/o YJIT — "markus_d (Markus Doits) via ruby-core" <ruby-core@...>

Issue #20890 has been reported by markus_d (Markus Doits).

24 messages 2024/11/12

[#119988] [Ruby master Bug#20904] 3.4.0-preview2: Building miniruby.exe fails for mswin32 — "jun66j5 (Jun Omae) via ruby-core" <ruby-core@...>

Issue #20904 has been reported by jun66j5 (Jun Omae).

11 messages 2024/11/22

[#120002] [Ruby master Bug#20908] Ruby extension builds fail with GCC 15 which defaults to -std=gnu23 — "thesamesam (Sam James) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTA4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRoZXNhbWVzYW0gKFNhbSBKYW1lcyku

7 messages 2024/11/25

[#120016] [Ruby master Feature#20912] Move warning when redefining object_id to __id__ — "jhawthorn (John Hawthorn) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwOTEyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGpoYXd0aG9ybiAoSm9obiBIYXd0aG9y

11 messages 2024/11/27

[#120027] [Ruby master Misc#20913] Proposal: Adding Jeremy Evans and Burdette Lamar to www.ruby-lang.org's English Editorial Team — "st0012 (Stan Lo) via ruby-core" <ruby-core@...>

Issue #20913 has been reported by st0012 (Stan Lo).

6 messages 2024/11/27

[#120043] [Ruby master Bug#20919] IO#seek does not clear the character buffer in some cases while transcoding — "javanthropus (Jeremy Bopp) via ruby-core" <ruby-core@...>

Issue #20919 has been reported by javanthropus (Jeremy Bopp).

7 messages 2024/11/28

[ruby-core:119973] [Ruby master Feature#20902] Allow `IO::Buffer#copy` to release the GVL.

From: "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>
Date: 2024-11-20 07:33:01 UTC
List: ruby-core #119973
Issue #20902 has been updated by ioquatix (Samuel Williams).


In addition to this proposal, which is limited to `IO::Buffer`, maybe we should consider introducing a general `rb_memmove` which releases the GVL according to the same heuristic driven approach. However, I feel that is a bigger proposal and outside the scope of this feature.

----------------------------------------
Feature #20902: Allow `IO::Buffer#copy` to release the GVL.
https://bugs.ruby-lang.org/issues/20902#change-110709

* Author: ioquatix (Samuel Williams)
* Status: Open
----------------------------------------
Related to <https://bugs.ruby-lang.org/issues/20876>.

## Background

`IO::Buffer#copy` execution time is proportional to the length of the data copied. As such, large copies can take a long time (100ms+). Currently, the GVL is not released, which can stall the Ruby interpreter.

## Proposal

Pull Request: https://github.com/ruby/ruby/pull/12021

If the size of the data to be copied is larger than a specific amount (heuristic), we will perform `memmove` using `rb_nogvl`.

The initial size heuristic is set to 1MiB. This won't be perfect for every system, but should be good enough to avoid ms+ stalls.

## Results

I measured the difference:

| GVL | Threads | Buffer Size | Total Duration | Throughput (MB/s) |
|-----|---------|-------------|----------------|-------------------|
| Yes |       1 |           1 |         0.12ms |           8393.09 |
| Yes |       1 |           5 |         0.51ms |            9857.7 |
| Yes |       1 |          10 |         1.12ms |           8937.54 |
| Yes |       1 |          20 |         2.22ms |           9015.95 |
| Yes |       2 |           1 |         0.24ms |           8307.07 |
| Yes |       2 |           5 |         1.13ms |           8819.58 |
| Yes |       2 |          10 |         1.49ms |          13385.35 |
| Yes |       2 |          20 |         5.63ms |            7110.8 |
| Yes |       4 |           1 |         0.92ms |           4360.18 |
| Yes |       4 |           5 |         2.08ms |           9606.58 |
| Yes |       4 |          10 |         4.51ms |           8863.13 |
| Yes |       4 |          20 |          9.3ms |           8601.41 |
| Yes |       8 |           1 |         1.22ms |           6574.93 |
| Yes |       8 |           5 |         3.56ms |          11239.27 |
| Yes |       8 |          10 |         7.31ms |          10943.68 |
| Yes |       8 |          20 |        15.57ms |          10274.99 |
| Yes |      16 |           1 |         1.95ms |           8220.16 |
| Yes |      16 |           5 |         5.51ms |          14518.05 |
| Yes |      16 |          10 |        13.77ms |          11618.96 |
| Yes |      16 |          20 |        27.21ms |          11759.43 |
| Yes |      32 |           1 |         3.24ms |           9891.05 |
| Yes |      32 |           5 |        11.42ms |          14007.41 |
| Yes |      32 |          10 |        21.64ms |          14786.48 |
| Yes |      32 |          20 |        45.52ms |          14060.25 |
|  No |       1 |           1 |         0.13ms |           7582.85 |
|  No |       1 |           5 |         0.44ms |          11248.55 |
|  No |       1 |          10 |         1.11ms |           9029.91 |
|  No |       1 |          20 |         2.43ms |           8228.42 |
|  No |       2 |           1 |         0.18ms |          11245.61 |
|  No |       2 |           5 |         0.96ms |          10396.76 |
|  No |       2 |          10 |          1.9ms |          10501.59 |
|  No |       2 |          20 |         3.16ms |          12656.77 |
|  No |       4 |           1 |         0.69ms |           5827.76 |
|  No |       4 |           5 |         1.15ms |          17440.54 |
|  No |       4 |          10 |         2.31ms |          17307.79 |
|  No |       4 |          20 |         4.11ms |          19483.68 |
|  No |       8 |           1 |         0.67ms |           11954.1 |
|  No |       8 |           5 |          1.3ms |          30713.68 |
|  No |       8 |          10 |         2.05ms |          38990.98 |
|  No |       8 |          20 |         4.15ms |          38552.37 |
|  No |      16 |           1 |         0.96ms |          16698.03 |
|  No |      16 |           5 |         1.46ms |          54782.47 |
|  No |      16 |          10 |         2.74ms |          58295.64 |
|  No |      16 |          20 |         4.89ms |          65482.43 |
|  No |      32 |           1 |         1.82ms |          17554.27 |
|  No |      32 |           5 |         2.68ms |          59673.59 |
|  No |      32 |          10 |         3.87ms |          82733.34 |
|  No |      32 |          20 |         6.93ms |          92297.47 |

In the base case, the performance is about the same, but in the best case, the throughput is significantly better: 15GiB/s vs 92GiB/s (32 threads copying 20MiB of data).




-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- [email protected]
 To unsubscribe send an email to [email protected]
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread

Prev Next