Skip to content

Commit a4b9a95

Browse files
Merge pull request #349 from oli-obk/master
Add a new const eval perf problem to the test suite
2 parents 518b0a7 + 6f8e82e commit a4b9a95

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

collector/benchmarks/ctfe-stress/Cargo.lock renamed to collector/benchmarks/ctfe-stress-2/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[package]
2-
name = "ctfe-stress"
2+
name = "ctfe-stress-2"
33
version = "0.1.0"
44
authors = ["Ralf Jung <[email protected]>"]

collector/benchmarks/ctfe-stress/src/lib.rs renamed to collector/benchmarks/ctfe-stress-2/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// And without support for loops.
55

66
macro_rules! const_repeat {
7-
// Base case: Use 16 at the end to avoid function calls at the leaves as much as possibele.
7+
// Base case: Use 16 at the end to avoid function calls at the leafs as much as possible.
88
([16] $e: expr, $T: ty) => {{
99
$e; $e; $e; $e;
1010
$e; $e; $e; $e;
@@ -60,3 +60,8 @@ expensive_static!(OPS: i32 = ((((10 >> 1) + 3) * 7) / 2 - 12) << 4; [4 16 16 16
6060
expensive_static!(RELOCATIONS : &'static str = "hello"; [8 16 16 16 16]);
6161
expensive_static!(UNSIZE_SLICE: &'static [u8] = b"foo"; [4 16 16 16 16 16]);
6262
expensive_static!(UNSIZE_TRAIT: &'static Trait = &42u32; [4 16 16 16 16 16]);
63+
64+
// copying all these zeros and the corresponding definedness bits can be expensive and is probably
65+
// prone to regressions.
66+
// 24 is an exponent that makes the repeat expression take less than two seconds to compute
67+
const FOO: [i32; 1 << 24] = [0; 1 << 24];

0 commit comments

Comments
 (0)