summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2024-08-31 18:51:41 +0900
committernagachika <nagachika@ruby-lang.org>2024-08-31 18:51:41 +0900
commitf095a085a43b609be6282fcc27ab7fe859259dfc (patch)
tree6bf2ecd7042618fdf1db8447a3afc7d348128f11
parentf4847607ee52040fc62531f37001ea1a22acd856 (diff)
merge revision(s) 8a7e6f6852740e989ef8f679db5631306466a4ed:
Improve base time of assert_linear_performance (#11369) Remove `.ceil` from base time calculation that makes 10x gap. This will make the assertion more strict and also less flaky.
-rw-r--r--tool/lib/core_assertions.rb4
-rw-r--r--version.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 2c8bc7f359..6b67da8334 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -778,7 +778,9 @@ eom
end
times.compact!
tmin, tmax = times.minmax
- tbase = 10 ** Math.log10(tmax * ([(tmax / tmin), 2].max ** 2)).ceil
+
+ # safe_factor * tmax * rehearsal_time_variance_factor(equals to 1 when variance is small)
+ tbase = 10 * tmax * [(tmax / tmin) ** 2 / 4, 1].max
info = "(tmin: #{tmin}, tmax: #{tmax}, tbase: #{tbase})"
seq.each do |i|
diff --git a/version.h b/version.h
index 212e603ecf..3af432833e 100644
--- a/version.h
+++ b/version.h
@@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 5
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 220
+#define RUBY_PATCHLEVEL 221
#include "ruby/version.h"
#include "ruby/internal/abi.h"