Skip to content

[pull] master from ruby:master - #1378

Merged
pull[bot] merged 4 commits into
turkdevops:masterfrom
ruby:master
Sep 4, 2026
Merged

[pull] master from ruby:master#1378
pull[bot] merged 4 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 4, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

kddnewton and others added 4 commits September 4, 2026 13:17
When escaped newlines are encountered, they are added to the newline
list. We need to check that we aren't backing up to read the rest of
the line because of a heredoc, in which case the newline would have
already have been added to the list.

ruby/prism@a3f8ba3d4a
This makes Fixnum.intersect(some user class Foo) result in Empty instead
of previously some nonsense value like Fixnum[Foo].

This allows folding a lot of calls to `IsA` to `false` that were not possible before.

Drops total number of calls to `rb_obj_is_kind_of` from 3.5MM to 2.9MM
on lobsters.

```diff
--- /tmp/ccalls-before.txt
+++ /tmp/ccalls-after.txt
@@ -1,9 +1,9 @@
-Top-20 calls to C functions from JIT code (69.8% of total 87,587,232):
-  rb_vm_opt_send_without_block: 9,913,465 (11.3%)
-                  rb_hash_aref: 9,901,809 (11.3%)
-                   rb_ivar_get: 6,116,145 ( 7.0%)
-            rb_gc_writebarrier: 5,463,959 ( 6.2%)
+          Array#reverse_each:   236,567 ( 1.0%)
+Top-20 calls to C functions from JIT code (69.6% of total 86,987,847):
+  rb_vm_opt_send_without_block: 9,913,448 (11.4%)
+                  rb_hash_aref: 9,901,807 (11.4%)
+                   rb_ivar_get: 6,116,147 ( 7.0%)
+            rb_gc_writebarrier: 5,463,952 ( 6.3%)
              rb_vm_invokeblock: 4,348,396 ( 5.0%)
-                    rb_vm_send: 3,874,202 ( 4.4%)
-                    Hash#fetch: 3,705,675 ( 4.2%)
-             rb_obj_is_kind_of: 3,507,142 ( 4.0%)
-                  rb_hash_aset: 2,916,632 ( 3.3%)
-     rb_vm_getinstancevariable: 2,325,583 ( 2.7%)
-                     Hash#key?: 1,411,874 ( 1.6%)
+                    rb_vm_send: 3,874,201 ( 4.5%)
+                    Hash#fetch: 3,705,677 ( 4.3%)
+                  rb_hash_aset: 2,916,628 ( 3.4%)
+             rb_obj_is_kind_of: 2,897,725 ( 3.3%)
+     rb_vm_getinstancevariable: 2,325,637 ( 2.7%)
```

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Calling these hook methods shouldn't create CCs because these are not hot methods.
These CCs were only looked up in the gccct table (global call cache lookup table)
for rb_funcall and friends.

For one of our apps after bootup we reduced CCs significantly:

|                       | A control  | B (your commit) | B − A                 |
|-----------------------|------------|-----------------|-----------------------|
| callcaches (after GC) | 705,957    | 651,747         | −54,210 (−7.7%)       |
| cc tables             | 46,361     | 43,051          | −3,310                |
| total cc memory       | 86,441,345 | 79,823,142      | −6,618,203 (−6.3 MB)  |
This lets us analyze HIR without redirecting all stdout somewhere.
@pull pull Bot locked and limited conversation to collaborators Sep 4, 2026
@pull pull Bot added the ⤵️ pull label Sep 4, 2026
@pull
pull Bot merged commit 8cf4dc8 into turkdevops:master Sep 4, 2026
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants