diff options
| author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2021-03-12 10:41:58 -0500 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:31 -0400 |
| commit | 439db7b81b588a1ee12475568cab7b8dab4e2cd3 (patch) | |
| tree | e09c24c254791e56a12379007f5b6e0679ea72d1 | |
| parent | cee597bd01ef999d5b8b86b639260282aa594467 (diff) | |
Add metric for average # of insns spent in yjit before exiting
| -rw-r--r-- | yjit_iface.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/yjit_iface.c b/yjit_iface.c index 9d8087e4ab..df5f4baa87 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -664,6 +664,10 @@ print_insn_count_buffer(const struct insn_count *buffer, int how_many, int left_ total_exit_count += buffer[i].count; } + // Average length of instruction sequences executed by YJIT + double avg_len_in_yjit = (double)yjit_runtime_counters.exec_instruction / total_exit_count; + + fprintf(stderr, "avg_len_in_yjit: %10.1f\n", avg_len_in_yjit); fprintf(stderr, "total_exit_count: %10ld\n", total_exit_count); fprintf(stderr, "most frequent exit op:\n"); @@ -696,7 +700,6 @@ print_yjit_stats(void) fprintf(stderr, "yjit_exec_insns_count: %10" PRId64 "\n", yjit_runtime_counters.exec_instruction); fprintf(stderr, "ratio_in_yjit: %9.1f%%\n", ratio * 100); print_insn_count_buffer(sorted_exit_ops, 10, 4); - //print_runtime_counters(); } #endif // if RUBY_DEBUG @@ -798,7 +801,7 @@ rb_yjit_init(struct rb_yjit_options *options) rb_yjit_opts = *options; rb_yjit_opts.yjit_enabled = true; - // Normalize options + // Normalize command-line options if (rb_yjit_opts.call_threshold < 1) { rb_yjit_opts.call_threshold = 2; } |
