@@ -28,7 +28,7 @@ use tokio::runtime::Runtime;
28
28
use collector:: compile:: execute:: bencher:: BenchProcessor ;
29
29
use collector:: compile:: execute:: profiler:: { ProfileProcessor , Profiler } ;
30
30
use collector:: runtime:: {
31
- bench_runtime, runtime_benchmark_dir, BenchmarkFilter , BenchmarkSuite , CargoIsolationMode ,
31
+ bench_runtime, runtime_benchmark_dir, BenchmarkFilter , CargoIsolationMode ,
32
32
DEFAULT_RUNTIME_ITERATIONS ,
33
33
} ;
34
34
use collector:: toolchain:: {
@@ -79,7 +79,7 @@ fn bench(
79
79
benchmarks : & [ Benchmark ] ,
80
80
iterations : Option < usize > ,
81
81
is_self_profile : bool ,
82
- mut collector : CollectorCtx ,
82
+ collector : & CollectorCtx ,
83
83
) -> BenchmarkErrors {
84
84
let mut errors = BenchmarkErrors :: new ( ) ;
85
85
eprintln ! (
@@ -756,7 +756,7 @@ fn main_result() -> anyhow::Result<i32> {
756
756
let fut = bench_runtime (
757
757
conn,
758
758
suite,
759
- collector,
759
+ & collector,
760
760
BenchmarkFilter :: new ( local. exclude , local. include ) ,
761
761
iterations,
762
762
) ;
@@ -812,7 +812,7 @@ fn main_result() -> anyhow::Result<i32> {
812
812
& benchmarks,
813
813
Some ( iterations) ,
814
814
self_profile. self_profile ,
815
- collector,
815
+ & collector,
816
816
) ;
817
817
res. fail_if_nonzero ( ) ?;
818
818
Ok ( 0 )
@@ -889,7 +889,7 @@ fn main_result() -> anyhow::Result<i32> {
889
889
& benchmarks,
890
890
runs. map ( |v| v as usize ) ,
891
891
self_profile. self_profile ,
892
- collector,
892
+ & collector,
893
893
) ;
894
894
895
895
client. post ( format ! ( "{}/perf/onpush" , site_url) ) . send ( ) ?;
@@ -1063,17 +1063,6 @@ async fn init_compile_collector(
1063
1063
. await
1064
1064
}
1065
1065
1066
- async fn init_runtime_collector (
1067
- connection : & mut dyn Connection ,
1068
- suite : & BenchmarkSuite ,
1069
- artifact_id : ArtifactId ,
1070
- ) -> CollectorCtx {
1071
- CollectorStepBuilder :: default ( )
1072
- . record_runtime_benchmarks ( suite)
1073
- . start_collection ( connection, artifact_id)
1074
- . await
1075
- }
1076
-
1077
1066
fn bench_published_artifact (
1078
1067
toolchain : & Toolchain ,
1079
1068
mut connection : Box < dyn Connection > ,
@@ -1096,13 +1085,19 @@ fn bench_published_artifact(
1096
1085
let mut compile_benchmarks = get_compile_benchmarks ( dirs. compile , None , None , None ) ?;
1097
1086
compile_benchmarks. retain ( |b| b. category ( ) . is_stable ( ) ) ;
1098
1087
1088
+ let runtime_suite = runtime:: prepare_runtime_benchmark_suite (
1089
+ toolchain,
1090
+ dirs. runtime ,
1091
+ CargoIsolationMode :: Isolated ,
1092
+ ) ?;
1093
+
1099
1094
let artifact_id = ArtifactId :: Tag ( toolchain. id . clone ( ) ) ;
1100
- let collector = rt. block_on ( init_compile_collector (
1101
- connection . as_mut ( ) ,
1102
- & compile_benchmarks,
1103
- /* bench_rustc */ false ,
1104
- artifact_id . clone ( ) ,
1105
- ) ) ;
1095
+ let collector = rt. block_on (
1096
+ CollectorStepBuilder :: default ( )
1097
+ . record_compile_benchmarks ( & compile_benchmarks, false )
1098
+ . record_runtime_benchmarks ( & runtime_suite )
1099
+ . start_collection ( connection . as_mut ( ) , artifact_id ) ,
1100
+ ) ;
1106
1101
let res = bench (
1107
1102
rt,
1108
1103
connection. as_mut ( ) ,
@@ -1112,26 +1107,16 @@ fn bench_published_artifact(
1112
1107
& compile_benchmarks,
1113
1108
Some ( 3 ) ,
1114
1109
/* is_self_profile */ false ,
1115
- collector,
1110
+ & collector,
1116
1111
) ;
1117
1112
let compile_result = res. fail_if_nonzero ( ) . context ( "Compile benchmarks failed" ) ;
1118
1113
1119
1114
// Runtime benchmarks
1120
- let runtime_suite = runtime:: prepare_runtime_benchmark_suite (
1121
- toolchain,
1122
- dirs. runtime ,
1123
- CargoIsolationMode :: Isolated ,
1124
- ) ?;
1125
- let collector = rt. block_on ( init_runtime_collector (
1126
- connection. as_mut ( ) ,
1127
- & runtime_suite,
1128
- artifact_id,
1129
- ) ) ;
1130
1115
let runtime_result = rt
1131
1116
. block_on ( bench_runtime (
1132
1117
connection,
1133
1118
runtime_suite,
1134
- collector,
1119
+ & collector,
1135
1120
BenchmarkFilter :: keep_all ( ) ,
1136
1121
DEFAULT_RUNTIME_ITERATIONS ,
1137
1122
) )
0 commit comments