Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: Add splat optimized_send #7167

Merged
merged 1 commit into from Jan 30, 2023

Conversation

jimmyhmiller
Copy link
Contributor

Big change here is in liquid-render where we go from 18978 exits for args_splat_optimized to 4219 iseq_splat_with_opt exits. Once this is combined with #7166 those numbers should go down as well.

Before
ruby 3.3.0dev (2023-01-20T21:07:03Z master 887d21613c) +YJIT dev [arm64-darwin22]
***YJIT: Printing YJIT statistics on exit***
method call exit reasons: 
                iseq_has_rest      41227 (66.1%)
         args_splat_optimized      18978 (30.4%)
                    block_arg       1324 ( 2.1%)
                zsuper_method        792 ( 1.3%)
        cfunc_ruby_array_varg         39 ( 0.1%)
     iseq_missing_optional_kw         39 ( 0.1%)
    args_splat_cfunc_var_args         11 ( 0.0%)
              ivar_set_method          1 ( 0.0%)
invokeblock exit reasons: 
                proc         90 (95.7%)
    iseq_tag_changed          4 ( 4.3%)
invokesuper exit reasons: 
    block          5 (100.0%)
leave exit reasons: 
        interp_return     287962 (100.0%)
    start_pc_non_zero        105 ( 0.0%)
         se_interrupt         16 ( 0.0%)
getblockparamproxy exit reasons: 
    (all relevant counters are zero)
getinstancevariable exit reasons:
    megamorphic          8 (100.0%)
setinstancevariable exit reasons:
    (all relevant counters are zero)
opt_aref exit reasons: 
    (all relevant counters are zero)
expandarray exit reasons: 
    (all relevant counters are zero)
opt_getinlinecache exit reasons: 
    (all relevant counters are zero)
invalidation reasons: 
       constant_ic_fill        149 (84.2%)
    constant_state_bump         19 (10.7%)
          method_lookup          9 ( 5.1%)
bindings_allocations:          77
bindings_set:                   0
compiled_iseq_count:          694
compiled_block_count:        5894
compiled_branch_count:       9771
block_next_count:            2019
defer_count:                 1992
freed_iseq_count:             181
invalidation_count:           177
constant_state_bumps:           0
inline_code_size:          920596
outlined_code_size:        918748
freed_code_size:                0
code_region_size:         1851392
yjit_alloc_size:         12031174
live_page_count:              113
freed_page_count:               0
code_gc_count:                  0
num_gc_obj_refs:             3878
object_shape_count:           538
side_exit_count:            84932
total_exit_count:          372894
total_insns_count:       19298312
vm_insns_count:           2599787
yjit_insns_count:        16783457
ratio_in_yjit:              86.5%
avg_len_in_yjit:             44.8
Top-12 most frequent exit ops (100.0% of exits):
    opt_send_without_block:      61372 (72.3%)
                     throw:      21517 (25.3%)
                      send:       1324 (1.6%)
      opt_getconstant_path:        369 (0.4%)
               invokesuper:        126 (0.1%)
               invokeblock:         94 (0.1%)
                    opt_eq:         87 (0.1%)
                     leave:         16 (0.0%)
                      once:         12 (0.0%)
          putspecialobject:         12 (0.0%)
                  opt_ltlt:          2 (0.0%)
                  opt_aref:          1 (0.0%)
itr #1: 562ms
After
ruby 3.3.0dev (2023-01-20T21:54:19Z yjit-send-splat-init 7a6345afb7) +YJIT dev [arm64-darwin22]
***YJIT: Printing YJIT statistics on exit***
method call exit reasons: 
                iseq_has_rest      41226 (86.5%)
          iseq_splat_with_opt       4219 ( 8.9%)
                    block_arg       1324 ( 2.8%)
                zsuper_method        792 ( 1.7%)
        cfunc_ruby_array_varg         39 ( 0.1%)
     iseq_missing_optional_kw         39 ( 0.1%)
    args_splat_cfunc_var_args         11 ( 0.0%)
              ivar_set_method          1 ( 0.0%)
invokeblock exit reasons: 
                proc         90 (95.7%)
    iseq_tag_changed          4 ( 4.3%)
invokesuper exit reasons: 
    block          5 (100.0%)
leave exit reasons: 
        interp_return     287940 (100.0%)
    start_pc_non_zero        105 ( 0.0%)
         se_interrupt         13 ( 0.0%)
getblockparamproxy exit reasons: 
    (all relevant counters are zero)
getinstancevariable exit reasons:
    megamorphic          8 (100.0%)
setinstancevariable exit reasons:
    (all relevant counters are zero)
opt_aref exit reasons: 
    (all relevant counters are zero)
expandarray exit reasons: 
    (all relevant counters are zero)
opt_getinlinecache exit reasons: 
    (all relevant counters are zero)
invalidation reasons: 
       constant_ic_fill        149 (84.2%)
    constant_state_bump         19 (10.7%)
          method_lookup          9 ( 5.1%)
bindings_allocations:          77
bindings_set:                   0
compiled_iseq_count:          694
compiled_block_count:        5911
compiled_branch_count:       9812
block_next_count:            2033
defer_count:                 1992
freed_iseq_count:             181
invalidation_count:           177
constant_state_bumps:           0
inline_code_size:          929836
outlined_code_size:        927636
freed_code_size:                0
code_region_size:         1867776
yjit_alloc_size:         12134656
live_page_count:              114
freed_page_count:               0
code_gc_count:                  0
num_gc_obj_refs:             3942
object_shape_count:           538
side_exit_count:            70161
total_exit_count:          358101
total_insns_count:       19421037
vm_insns_count:           2541164
yjit_insns_count:        16950034
ratio_in_yjit:              86.9%
avg_len_in_yjit:             47.1
Top-12 most frequent exit ops (100.0% of exits):
    opt_send_without_block:      46604 (66.4%)
                     throw:      21516 (30.7%)
                      send:       1324 (1.9%)
      opt_getconstant_path:        370 (0.5%)
               invokesuper:        126 (0.2%)
               invokeblock:         94 (0.1%)
                    opt_eq:         87 (0.1%)
                     leave:         13 (0.0%)
                      once:         12 (0.0%)
          putspecialobject:         12 (0.0%)
                  opt_ltlt:          2 (0.0%)
                   opt_neq:          1 (0.0%)
itr #1: 569ms

@matzbot matzbot requested a review from a team January 20, 2023 22:02
@jimmyhmiller
Copy link
Contributor Author

Looking into this failure today

Copy link
Contributor

@maximecb maximecb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. Pretty soon we'll have (almost) no send exits in liquid :)

@maximecb maximecb merged commit 07d1b3d into ruby:master Jan 30, 2023
matzbot pushed a commit that referenced this pull request Dec 13, 2023
@nurse nurse mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants