@@ -6,7 +6,7 @@ use crate::execute::{CargoProcess, Processor};
6
6
use crate :: toolchain:: Compiler ;
7
7
use anyhow:: { bail, Context } ;
8
8
use log:: debug;
9
- use std:: collections:: HashMap ;
9
+ use std:: collections:: { HashMap , HashSet } ;
10
10
use std:: fs:: File ;
11
11
use std:: mem:: ManuallyDrop ;
12
12
use std:: path:: { Path , PathBuf } ;
@@ -41,6 +41,10 @@ struct BenchmarkConfig {
41
41
touch_file : Option < String > ,
42
42
43
43
category : Category ,
44
+ /// Profiles that are not useful for this benchmark.
45
+ /// They will be ignored during benchmarking.
46
+ #[ serde( default ) ]
47
+ excluded_profiles : HashSet < Profile > ,
44
48
}
45
49
46
50
#[ derive( Ord , PartialOrd , Eq , PartialEq , Clone , Hash ) ]
@@ -183,11 +187,22 @@ impl Benchmark {
183
187
) -> anyhow:: Result < ( ) > {
184
188
let iterations = iterations. unwrap_or ( self . config . runs ) ;
185
189
186
- if self . config . disabled || profiles. is_empty ( ) {
190
+ let profiles: Vec < Profile > = profiles
191
+ . into_iter ( )
192
+ . copied ( )
193
+ . filter ( |profile| !self . config . excluded_profiles . contains ( profile) )
194
+ . collect ( ) ;
195
+
196
+ if self . config . disabled {
187
197
eprintln ! ( "Skipping {}: disabled" , self . name) ;
188
198
bail ! ( "disabled benchmark" ) ;
189
199
}
190
200
201
+ if profiles. is_empty ( ) {
202
+ eprintln ! ( "Skipping {}: no profiles selected" , self . name) ;
203
+ return Ok ( ( ) ) ;
204
+ }
205
+
191
206
eprintln ! ( "Preparing {}" , self . name) ;
192
207
let profile_dirs = profiles
193
208
. iter ( )
0 commit comments