[pull] master from ruby:master - #1378
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )