[#100284] [Ruby master Bug#17211] Test failures in ruby2.7.2 and ruby3.0~preview1 — utkarsh@...

Issue #17211 has been reported by utkarsh (Utkarsh Gupta).

10 messages 2020/10/02

[#100301] [Ruby master Feature#17215] Backport for arm64 optimizations that exist for power/x86 — jaruga@...

Issue #17215 has been reported by jaruga (Jun Aruga).

10 messages 2020/10/05

[#100329] [Ruby master Bug#17220] Rails Active Job integration test fails with Ruby 3.0.0 since 2038cc6cab6ceeffef3ec3a765c70ae684f829ed — yasuo.honda@...

Issue #17220 has been reported by yahonda (Yasuo Honda).

28 messages 2020/10/07

[#100332] [Ruby master Bug#17221] Relax the Fiber#transfer's limitation — ko1@...

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

15 messages 2020/10/07

[#100348] [Ruby master Bug#17257] Integer#pow(0, 1) returns 1, which is incorrect — universato@...

Issue #17257 has been reported by universato (Yoshimine Sato).

13 messages 2020/10/09

[#100371] [Ruby master Feature#17260] Promote pattern matching to official feature — kazuki@...

Issue #17260 has been reported by ktsj (Kazuki Tsujimoto).

10 messages 2020/10/11

[#100383] [Ruby master Feature#17261] Software transactional memory (STM) for Threads and Ractors — ko1@...

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

14 messages 2020/10/12

[#100401] [Ruby master Bug#17263] Fiber context switch degrades with number of fibers, limit on number of fibers — ciconia@...

Issue #17263 has been reported by ciconia (Sharon Rosner).

14 messages 2020/10/15

[#100422] [CommonRuby Feature#17265] Add `Bool` module — marcandre-ruby-core@...

Issue #17265 has been reported by marcandre (Marc-Andre Lafortune).

11 messages 2020/10/19

[#100466] [Ruby master Feature#17273] shareable_constant_value pragma — ko1@...

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

14 messages 2020/10/21

[#100471] [Ruby master Feature#17277] Make Enumerator#with_index yield row and col indices for Matrix — grzegorz.jakubiak@...

Issue #17277 has been reported by greggzst (Grzegorz Jakubiak).

8 messages 2020/10/21

[#100479] [Ruby master Feature#17278] On-demand sharing of constants for Ractor [email protected]

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

13 messages 2020/10/21

[#100534] [Ruby master Feature#17284] Shareable Proc — ko1@...

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

16 messages 2020/10/25

[#100597] [Ruby master Feature#17288] Optimize __send__ call with a literal method name — muraken@...

Issue #17288 has been reported by mrkn (Kenta Murata).

13 messages 2020/10/27

[#100669] [Ruby master Feature#17295] Feature: Create a directory and file with Pathname#touch — get.codetriage@...

Issue #17295 has been reported by schneems (Richard Schneeman).

9 messages 2020/10/30

[#100673] [Ruby master Feature#17298] Ractor's basket communication APIs — ko1@...

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

15 messages 2020/10/30

[#100675] [Ruby master Misc#17299] DevelopersMeeting20201120Japan — mame@...

Issue #17299 has been reported by mame (Yusuke Endoh).

11 messages 2020/10/31

[ruby-core:100319] [Ruby master Feature#17219] Make URI#hostname 18-20% and hostname= 31-156% faster

From: lukas@...
Date: 2020-10-07 08:38:55 UTC
List: ruby-core #100319
Issue #17219 has been updated by lzap (Lukas Zapletal).

File 3635.patch added

Attaching patch. Also available as https://github.com/ruby/ruby/pull/3635

----------------------------------------
Feature #17219: Make URI#hostname 18-20% and hostname=3D 31-156% faster
https://bugs.ruby-lang.org/issues/17219#change-87900

* Author: lzap (Lukas Zapletal)
* Status: Open
* Priority: Normal
----------------------------------------
Hello,

URI#hostname extends URI#host with IPv6 support. In URI, IPv6 address must =
have square brackets (e.g. `http://[2001:db8::1]`), URI#hostname strips the=
se characters out while URI#hostname=3D adds them if missing. There are thr=
ee regular expressions to perform these tasks which can dramatically slow d=
own performance. I am attaching a two-line patch and here is a benchmark: h=
ttps://gist.github.com/lzap/24cbecb47daf29111350e41a24250922

```
Calculating -------------------------------------
hostname on an ipv6 (orig)
                          4.018M (=B1 0.4%) i/s -     20.175M in   5.021128s
hostname on an ipv6 (new)
                          4.753M (=B1 0.5%) i/s -     23.930M in   5.034444s

Comparison:
hostname on an ipv6 (new):  4753483.7 i/s
hostname on an ipv6 (orig):  4018053.7 i/s - 1.18x  (=B1 0.00) slower

Calculating -------------------------------------
hostname on an ipv4 (orig)
                          4.145M (=B1 0.8%) i/s -     21.031M in   5.073638s
hostname on an ipv4 (new)
                          4.960M (=B1 0.6%) i/s -     25.142M in   5.069027s

Comparison:
hostname on an ipv4 (new):  4960111.9 i/s
hostname on an ipv4 (orig):  4145365.6 i/s - 1.20x  (=B1 0.00) slower

Calculating -------------------------------------
hostname on an host (orig)
                          4.183M (=B1 0.4%) i/s -     20.984M in   5.016865s
hostname on an host (new)
                          4.976M (=B1 0.7%) i/s -     25.213M in   5.066627s

Comparison:
hostname on an host (new):  4976454.5 i/s
hostname on an host (orig):  4182840.9 i/s - 1.19x  (=B1 0.00) slower

Calculating -------------------------------------
hostname=3D on an ipv6 (orig)
                        958.023k (=B1 1.1%) i/s -      4.798M in   5.008884s
hostname=3D on an ipv6 (new)
                          1.252M (=B1 1.2%) i/s -      6.337M in   5.063109s

Comparison:
hostname=3D on an ipv6 (new):  1251868.4 i/s
hostname=3D on an ipv6 (orig):   958023.5 i/s - 1.31x  (=B1 0.00) slower

Calculating -------------------------------------
hostname=3D on an ipv4 (orig)
                          2.246M (=B1 1.0%) i/s -     11.392M in   5.073679s
hostname=3D on an ipv4 (new)
                          5.739M (=B1 0.3%) i/s -     29.246M in   5.095776s

Comparison:
hostname=3D on an ipv4 (new):  5739237.9 i/s
hostname=3D on an ipv4 (orig):  2245518.7 i/s - 2.56x  (=B1 0.00) slower

Calculating -------------------------------------
hostname=3D on an host (orig)
                          2.266M (=B1 0.7%) i/s -     11.504M in   5.076980s
hostname=3D on an host (new)
                          5.795M (=B1 0.5%) i/s -     29.263M in   5.049941s

Comparison:
hostname=3D on an host (new):  5794820.2 i/s
hostname=3D on an host (orig):  2266068.9 i/s - 2.56x  (=B1 0.00) slower
```

A patch and a PR incoming.

---Files--------------------------------
3635.patch (974 Bytes)


-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread