[前][次][番号順一覧][スレッド一覧]

ruby-changes:68918

From: Noah <ko1@a...>
Date: Thu, 21 Oct 2021 08:16:35 +0900 (JST)
Subject: [ruby-changes:68918] e2fe7e4aff (master): Percentages should be out of 100.0%, not 1.0%.

https://git.ruby-lang.org/ruby.git/commit/?id=e2fe7e4aff

From e2fe7e4aff27f498d56e44586276558355da34dd Mon Sep 17 00:00:00 2001
From: Noah Gibbs <noah.gibbs@s...>
Date: Wed, 30 Jun 2021 09:41:19 +0100
Subject: Percentages should be out of 100.0%, not 1.0%.

---
 yjit.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/yjit.rb b/yjit.rb
index db283fe33b..cf5cac5f2f 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -190,7 +190,7 @@ module YJIT https://github.com/ruby/ruby/blob/trunk/yjit.rb#L190
       total_exits = total_exit_count(stats)
 
       top_n_total = exits.map { |name, count| count }.sum
-      top_n_exit_pct = top_n_total / total_exits
+      top_n_exit_pct = 100.0 * top_n_total / total_exits
 
       $stderr.puts "Top-#{how_many} most frequent exit ops (#{"%.1f" % top_n_exit_pct}% of exits):"
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]