From b67b7d420d78dd3fb372fc334bab77147c93e51a Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Tue, 19 Feb 2019 11:30:42 +0100 Subject: [PATCH 1/2] Add a new const eval perf problem to the test suite --- collector/benchmarks/ctfe-stress/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collector/benchmarks/ctfe-stress/src/lib.rs b/collector/benchmarks/ctfe-stress/src/lib.rs index 2c9dec116..3b66a7115 100644 --- a/collector/benchmarks/ctfe-stress/src/lib.rs +++ b/collector/benchmarks/ctfe-stress/src/lib.rs @@ -4,7 +4,7 @@ // And without support for loops. macro_rules! const_repeat { - // Base case: Use 16 at the end to avoid function calls at the leaves as much as possibele. + // Base case: Use 16 at the end to avoid function calls at the leafs as much as possible. ([16] $e: expr, $T: ty) => {{ $e; $e; $e; $e; $e; $e; $e; $e; @@ -60,3 +60,8 @@ expensive_static!(OPS: i32 = ((((10 >> 1) + 3) * 7) / 2 - 12) << 4; [4 16 16 16 expensive_static!(RELOCATIONS : &'static str = "hello"; [8 16 16 16 16]); expensive_static!(UNSIZE_SLICE: &'static [u8] = b"foo"; [4 16 16 16 16 16]); expensive_static!(UNSIZE_TRAIT: &'static Trait = &42u32; [4 16 16 16 16 16]); + +// copying all these zeros and the corresponding definedness bits can be expensive and is probably +// prone to regressions. +// 24 is an exponent that makes the repeat expression take less than two seconds to compute +const FOO: [i32; 1 << 24] = [0; 1 << 24]; From 6f8e82eb83e78097d4f333b1808b01704cec3fe7 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 20 Feb 2019 09:31:09 +0100 Subject: [PATCH 2/2] Rename ctfe-stress to create distinct graphs --- collector/benchmarks/{ctfe-stress => ctfe-stress-2}/Cargo.lock | 2 +- collector/benchmarks/{ctfe-stress => ctfe-stress-2}/Cargo.toml | 2 +- collector/benchmarks/{ctfe-stress => ctfe-stress-2}/src/lib.rs | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename collector/benchmarks/{ctfe-stress => ctfe-stress-2}/Cargo.lock (57%) rename collector/benchmarks/{ctfe-stress => ctfe-stress-2}/Cargo.toml (74%) rename collector/benchmarks/{ctfe-stress => ctfe-stress-2}/src/lib.rs (100%) diff --git a/collector/benchmarks/ctfe-stress/Cargo.lock b/collector/benchmarks/ctfe-stress-2/Cargo.lock similarity index 57% rename from collector/benchmarks/ctfe-stress/Cargo.lock rename to collector/benchmarks/ctfe-stress-2/Cargo.lock index 3f3213ba3..01d53156e 100644 --- a/collector/benchmarks/ctfe-stress/Cargo.lock +++ b/collector/benchmarks/ctfe-stress-2/Cargo.lock @@ -1,4 +1,4 @@ [[package]] -name = "ctfe-stress" +name = "ctfe-stress-2" version = "0.1.0" diff --git a/collector/benchmarks/ctfe-stress/Cargo.toml b/collector/benchmarks/ctfe-stress-2/Cargo.toml similarity index 74% rename from collector/benchmarks/ctfe-stress/Cargo.toml rename to collector/benchmarks/ctfe-stress-2/Cargo.toml index e3b83556a..8f4d72a0e 100644 --- a/collector/benchmarks/ctfe-stress/Cargo.toml +++ b/collector/benchmarks/ctfe-stress-2/Cargo.toml @@ -1,4 +1,4 @@ [package] -name = "ctfe-stress" +name = "ctfe-stress-2" version = "0.1.0" authors = ["Ralf Jung "] diff --git a/collector/benchmarks/ctfe-stress/src/lib.rs b/collector/benchmarks/ctfe-stress-2/src/lib.rs similarity index 100% rename from collector/benchmarks/ctfe-stress/src/lib.rs rename to collector/benchmarks/ctfe-stress-2/src/lib.rs