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 88% rename from collector/benchmarks/ctfe-stress/src/lib.rs rename to collector/benchmarks/ctfe-stress-2/src/lib.rs index 2c9dec116..3b66a7115 100644 --- a/collector/benchmarks/ctfe-stress/src/lib.rs +++ b/collector/benchmarks/ctfe-stress-2/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];