summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMax Bernstein <rubybugs@bernsteinbear.com>2025-10-14 16:17:54 -0400
committerGitHub <noreply@github.com>2025-10-14 16:17:54 -0400
commitde9298635dc7dd212c9d80db404f20855b1426af (patch)
tree85b51fa48ced803d906435ef14aba13694a06be5 /libexec
parentd75207d0043c56034e68c306f6dfe5e7b4f09438 (diff)
ZJIT: Profile opt_size, opt_length, opt_regexpmatch2 (#14837)
These bring `send_without_block_no_profiles` numbers down more. On lobsters: Before: send_without_block_no_profiles: 1,293,375 After: send_without_block_no_profiles: 998,724 all stats before: ``` ***ZJIT: Printing ZJIT statistics on exit*** Top-20 not inlined C methods (71.1% of total 15,575,335): Hash#[]: 4,519,774 (29.0%) Kernel#is_a?: 1,030,758 ( 6.6%) String#<<: 851,929 ( 5.5%) Hash#[]=: 742,941 ( 4.8%) Regexp#match?: 399,889 ( 2.6%) String#empty?: 353,775 ( 2.3%) Hash#key?: 349,129 ( 2.2%) String#start_with?: 334,961 ( 2.2%) Kernel#respond_to?: 316,527 ( 2.0%) ObjectSpace::WeakKeyMap#[]: 238,978 ( 1.5%) TrueClass#===: 235,771 ( 1.5%) FalseClass#===: 231,144 ( 1.5%) Array#include?: 211,381 ( 1.4%) Hash#fetch: 204,702 ( 1.3%) Kernel#block_given?: 181,792 ( 1.2%) ActiveSupport::OrderedOptions#_get: 181,272 ( 1.2%) Kernel#dup: 179,340 ( 1.2%) BasicObject#!=: 175,997 ( 1.1%) Class#new: 168,078 ( 1.1%) Kernel#kind_of?: 165,600 ( 1.1%) Top-20 not annotated C methods (71.6% of total 15,737,478): Hash#[]: 4,519,784 (28.7%) Kernel#is_a?: 1,212,649 ( 7.7%) String#<<: 851,929 ( 5.4%) Hash#[]=: 743,120 ( 4.7%) Regexp#match?: 399,889 ( 2.5%) String#empty?: 361,013 ( 2.3%) Hash#key?: 349,129 ( 2.2%) String#start_with?: 334,961 ( 2.1%) Kernel#respond_to?: 316,527 ( 2.0%) ObjectSpace::WeakKeyMap#[]: 238,978 ( 1.5%) TrueClass#===: 235,771 ( 1.5%) FalseClass#===: 231,144 ( 1.5%) Array#include?: 211,381 ( 1.3%) Hash#fetch: 204,702 ( 1.3%) Kernel#block_given?: 191,661 ( 1.2%) ActiveSupport::OrderedOptions#_get: 181,272 ( 1.2%) Kernel#dup: 179,347 ( 1.1%) BasicObject#!=: 176,181 ( 1.1%) Class#new: 168,078 ( 1.1%) Kernel#kind_of?: 165,634 ( 1.1%) Top-2 not optimized method types for send (100.0% of total 72,318): cfunc: 48,055 (66.4%) iseq: 24,263 (33.6%) Top-6 not optimized method types for send_without_block (100.0% of total 4,523,648): iseq: 2,271,904 (50.2%) bmethod: 985,636 (21.8%) optimized: 949,702 (21.0%) alias: 310,746 ( 6.9%) null: 5,106 ( 0.1%) cfunc: 554 ( 0.0%) Top-13 not optimized instructions (100.0% of total 4,293,096): invokesuper: 2,373,391 (55.3%) invokeblock: 811,872 (18.9%) sendforward: 505,448 (11.8%) opt_eq: 451,754 (10.5%) opt_plus: 74,403 ( 1.7%) opt_minus: 36,225 ( 0.8%) opt_send_without_block: 21,792 ( 0.5%) opt_neq: 7,231 ( 0.2%) opt_mult: 6,752 ( 0.2%) opt_or: 3,753 ( 0.1%) opt_lt: 348 ( 0.0%) opt_ge: 91 ( 0.0%) opt_gt: 36 ( 0.0%) Top-9 send fallback reasons (100.0% of total 25,824,463): send_without_block_polymorphic: 9,721,727 (37.6%) send_no_profiles: 5,894,760 (22.8%) send_without_block_not_optimized_method_type: 4,523,648 (17.5%) not_optimized_instruction: 4,293,096 (16.6%) send_without_block_no_profiles: 1,293,386 ( 5.0%) send_not_optimized_method_type: 72,318 ( 0.3%) send_without_block_cfunc_array_variadic: 15,134 ( 0.1%) obj_to_string_not_string: 9,765 ( 0.0%) send_without_block_direct_too_many_args: 629 ( 0.0%) Top-9 unhandled YARV insns (100.0% of total 690,482): expandarray: 328,490 (47.6%) checkkeyword: 190,694 (27.6%) getclassvariable: 59,901 ( 8.7%) invokesuperforward: 49,503 ( 7.2%) getblockparam: 48,651 ( 7.0%) opt_duparray_send: 11,978 ( 1.7%) getconstant: 952 ( 0.1%) checkmatch: 290 ( 0.0%) once: 23 ( 0.0%) Top-3 compile error reasons (100.0% of total 3,752,502): register_spill_on_alloc: 3,457,791 (92.1%) register_spill_on_ccall: 176,348 ( 4.7%) exception_handler: 118,363 ( 3.2%) Top-14 side exit reasons (100.0% of total 10,860,787): compile_error: 3,752,502 (34.6%) guard_type_failure: 2,638,903 (24.3%) guard_shape_failure: 1,917,195 (17.7%) unhandled_yarv_insn: 690,482 ( 6.4%) block_param_proxy_not_iseq_or_ifunc: 535,787 ( 4.9%) unhandled_kwarg: 421,943 ( 3.9%) patchpoint: 370,449 ( 3.4%) unknown_newarray_send: 314,785 ( 2.9%) unhandled_splat: 122,060 ( 1.1%) unhandled_hir_insn: 76,396 ( 0.7%) block_param_proxy_modified: 19,193 ( 0.2%) obj_to_string_fallback: 566 ( 0.0%) interrupt: 504 ( 0.0%) guard_type_not_failure: 22 ( 0.0%) send_count: 66,945,801 dynamic_send_count: 25,824,463 (38.6%) optimized_send_count: 41,121,338 (61.4%) iseq_optimized_send_count: 18,587,368 (27.8%) inline_cfunc_optimized_send_count: 6,958,635 (10.4%) non_variadic_cfunc_optimized_send_count: 12,911,155 (19.3%) variadic_cfunc_optimized_send_count: 2,664,180 ( 4.0%) dynamic_getivar_count: 7,365,975 dynamic_setivar_count: 7,245,897 compiled_iseq_count: 4,794 failed_iseq_count: 450 compile_time: 760ms profile_time: 9ms gc_time: 8ms invalidation_time: 55ms vm_write_pc_count: 64,284,053 vm_write_sp_count: 62,940,297 vm_write_locals_count: 62,940,297 vm_write_stack_count: 62,940,297 vm_write_to_parent_iseq_local_count: 292,446 vm_read_from_parent_iseq_local_count: 6,470,923 code_region_bytes: 23,019,520 side_exit_count: 10,860,787 total_insn_count: 517,576,320 vm_insn_count: 163,188,910 zjit_insn_count: 354,387,410 ratio_in_zjit: 68.5% ``` all stats after: ``` ***ZJIT: Printing ZJIT statistics on exit*** Top-20 not inlined C methods (70.4% of total 15,740,856): Hash#[]: 4,519,792 (28.7%) Kernel#is_a?: 1,030,776 ( 6.5%) String#<<: 851,940 ( 5.4%) Hash#[]=: 742,914 ( 4.7%) Regexp#match?: 399,887 ( 2.5%) String#empty?: 353,775 ( 2.2%) Hash#key?: 349,139 ( 2.2%) String#start_with?: 334,961 ( 2.1%) Kernel#respond_to?: 316,529 ( 2.0%) ObjectSpace::WeakKeyMap#[]: 238,978 ( 1.5%) TrueClass#===: 235,771 ( 1.5%) FalseClass#===: 231,144 ( 1.5%) Array#include?: 211,381 ( 1.3%) Hash#fetch: 204,702 ( 1.3%) Kernel#block_given?: 181,788 ( 1.2%) ActiveSupport::OrderedOptions#_get: 181,272 ( 1.2%) Kernel#dup: 179,341 ( 1.1%) BasicObject#!=: 175,996 ( 1.1%) Class#new: 168,079 ( 1.1%) Kernel#kind_of?: 165,600 ( 1.1%) Top-20 not annotated C methods (70.9% of total 15,902,999): Hash#[]: 4,519,802 (28.4%) Kernel#is_a?: 1,212,667 ( 7.6%) String#<<: 851,940 ( 5.4%) Hash#[]=: 743,093 ( 4.7%) Regexp#match?: 399,887 ( 2.5%) String#empty?: 361,013 ( 2.3%) Hash#key?: 349,139 ( 2.2%) String#start_with?: 334,961 ( 2.1%) Kernel#respond_to?: 316,529 ( 2.0%) ObjectSpace::WeakKeyMap#[]: 238,978 ( 1.5%) TrueClass#===: 235,771 ( 1.5%) FalseClass#===: 231,144 ( 1.5%) Array#include?: 211,381 ( 1.3%) Hash#fetch: 204,702 ( 1.3%) Kernel#block_given?: 191,657 ( 1.2%) ActiveSupport::OrderedOptions#_get: 181,272 ( 1.1%) Kernel#dup: 179,348 ( 1.1%) BasicObject#!=: 176,180 ( 1.1%) Class#new: 168,079 ( 1.1%) Kernel#kind_of?: 165,634 ( 1.0%) Top-2 not optimized method types for send (100.0% of total 72,318): cfunc: 48,055 (66.4%) iseq: 24,263 (33.6%) Top-6 not optimized method types for send_without_block (100.0% of total 4,523,637): iseq: 2,271,900 (50.2%) bmethod: 985,636 (21.8%) optimized: 949,695 (21.0%) alias: 310,746 ( 6.9%) null: 5,106 ( 0.1%) cfunc: 554 ( 0.0%) Top-13 not optimized instructions (100.0% of total 4,293,128): invokesuper: 2,373,401 (55.3%) invokeblock: 811,890 (18.9%) sendforward: 505,449 (11.8%) opt_eq: 451,754 (10.5%) opt_plus: 74,403 ( 1.7%) opt_minus: 36,228 ( 0.8%) opt_send_without_block: 21,792 ( 0.5%) opt_neq: 7,231 ( 0.2%) opt_mult: 6,752 ( 0.2%) opt_or: 3,753 ( 0.1%) opt_lt: 348 ( 0.0%) opt_ge: 91 ( 0.0%) opt_gt: 36 ( 0.0%) Top-9 send fallback reasons (100.0% of total 25,530,605): send_without_block_polymorphic: 9,722,499 (38.1%) send_no_profiles: 5,894,763 (23.1%) send_without_block_not_optimized_method_type: 4,523,637 (17.7%) not_optimized_instruction: 4,293,128 (16.8%) send_without_block_no_profiles: 998,732 ( 3.9%) send_not_optimized_method_type: 72,318 ( 0.3%) send_without_block_cfunc_array_variadic: 15,134 ( 0.1%) obj_to_string_not_string: 9,765 ( 0.0%) send_without_block_direct_too_many_args: 629 ( 0.0%) Top-9 unhandled YARV insns (100.0% of total 690,482): expandarray: 328,490 (47.6%) checkkeyword: 190,694 (27.6%) getclassvariable: 59,901 ( 8.7%) invokesuperforward: 49,503 ( 7.2%) getblockparam: 48,651 ( 7.0%) opt_duparray_send: 11,978 ( 1.7%) getconstant: 952 ( 0.1%) checkmatch: 290 ( 0.0%) once: 23 ( 0.0%) Top-3 compile error reasons (100.0% of total 3,752,500): register_spill_on_alloc: 3,457,792 (92.1%) register_spill_on_ccall: 176,348 ( 4.7%) exception_handler: 118,360 ( 3.2%) Top-14 side exit reasons (100.0% of total 10,860,797): compile_error: 3,752,500 (34.6%) guard_type_failure: 2,638,909 (24.3%) guard_shape_failure: 1,917,203 (17.7%) unhandled_yarv_insn: 690,482 ( 6.4%) block_param_proxy_not_iseq_or_ifunc: 535,784 ( 4.9%) unhandled_kwarg: 421,947 ( 3.9%) patchpoint: 370,474 ( 3.4%) unknown_newarray_send: 314,786 ( 2.9%) unhandled_splat: 122,067 ( 1.1%) unhandled_hir_insn: 76,395 ( 0.7%) block_param_proxy_modified: 19,193 ( 0.2%) obj_to_string_fallback: 566 ( 0.0%) interrupt: 469 ( 0.0%) guard_type_not_failure: 22 ( 0.0%) send_count: 66,945,326 dynamic_send_count: 25,530,605 (38.1%) optimized_send_count: 41,414,721 (61.9%) iseq_optimized_send_count: 18,587,439 (27.8%) inline_cfunc_optimized_send_count: 7,086,426 (10.6%) non_variadic_cfunc_optimized_send_count: 13,076,682 (19.5%) variadic_cfunc_optimized_send_count: 2,664,174 ( 4.0%) dynamic_getivar_count: 7,365,985 dynamic_setivar_count: 7,245,954 compiled_iseq_count: 4,794 failed_iseq_count: 450 compile_time: 748ms profile_time: 9ms gc_time: 8ms invalidation_time: 58ms vm_write_pc_count: 64,155,801 vm_write_sp_count: 62,812,041 vm_write_locals_count: 62,812,041 vm_write_stack_count: 62,812,041 vm_write_to_parent_iseq_local_count: 292,448 vm_read_from_parent_iseq_local_count: 6,470,939 code_region_bytes: 23,052,288 side_exit_count: 10,860,797 total_insn_count: 517,576,915 vm_insn_count: 163,192,099 zjit_insn_count: 354,384,816 ratio_in_zjit: 68.5% ```
Diffstat (limited to 'libexec')
0 files changed, 0 insertions, 0 deletions