@@ -28,7 +28,7 @@ use tokio::runtime::Runtime;
2828use collector:: compile:: execute:: bencher:: BenchProcessor ;
2929use collector:: compile:: execute:: profiler:: { ProfileProcessor , Profiler } ;
3030use collector:: runtime:: {
31- bench_runtime, runtime_benchmark_dir, BenchmarkFilter , BenchmarkSuite , CargoIsolationMode ,
31+ bench_runtime, runtime_benchmark_dir, BenchmarkFilter , CargoIsolationMode ,
3232 DEFAULT_RUNTIME_ITERATIONS ,
3333} ;
3434use collector:: toolchain:: {
@@ -79,7 +79,7 @@ fn bench(
7979 benchmarks : & [ Benchmark ] ,
8080 iterations : Option < usize > ,
8181 is_self_profile : bool ,
82- mut collector : CollectorCtx ,
82+ collector : & CollectorCtx ,
8383) -> BenchmarkErrors {
8484 let mut errors = BenchmarkErrors :: new ( ) ;
8585 eprintln ! (
@@ -756,7 +756,7 @@ fn main_result() -> anyhow::Result<i32> {
756756 let fut = bench_runtime (
757757 conn,
758758 suite,
759- collector,
759+ & collector,
760760 BenchmarkFilter :: new ( local. exclude , local. include ) ,
761761 iterations,
762762 ) ;
@@ -812,7 +812,7 @@ fn main_result() -> anyhow::Result<i32> {
812812 & benchmarks,
813813 Some ( iterations) ,
814814 self_profile. self_profile ,
815- collector,
815+ & collector,
816816 ) ;
817817 res. fail_if_nonzero ( ) ?;
818818 Ok ( 0 )
@@ -889,7 +889,7 @@ fn main_result() -> anyhow::Result<i32> {
889889 & benchmarks,
890890 runs. map ( |v| v as usize ) ,
891891 self_profile. self_profile ,
892- collector,
892+ & collector,
893893 ) ;
894894
895895 client. post ( format ! ( "{}/perf/onpush" , site_url) ) . send ( ) ?;
@@ -1063,17 +1063,6 @@ async fn init_compile_collector(
10631063 . await
10641064}
10651065
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-
10771066fn bench_published_artifact (
10781067 toolchain : & Toolchain ,
10791068 mut connection : Box < dyn Connection > ,
@@ -1096,13 +1085,19 @@ fn bench_published_artifact(
10961085 let mut compile_benchmarks = get_compile_benchmarks ( dirs. compile , None , None , None ) ?;
10971086 compile_benchmarks. retain ( |b| b. category ( ) . is_stable ( ) ) ;
10981087
1088+ let runtime_suite = runtime:: prepare_runtime_benchmark_suite (
1089+ toolchain,
1090+ dirs. runtime ,
1091+ CargoIsolationMode :: Isolated ,
1092+ ) ?;
1093+
10991094 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+ ) ;
11061101 let res = bench (
11071102 rt,
11081103 connection. as_mut ( ) ,
@@ -1112,26 +1107,16 @@ fn bench_published_artifact(
11121107 & compile_benchmarks,
11131108 Some ( 3 ) ,
11141109 /* is_self_profile */ false ,
1115- collector,
1110+ & collector,
11161111 ) ;
11171112 let compile_result = res. fail_if_nonzero ( ) . context ( "Compile benchmarks failed" ) ;
11181113
11191114 // 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- ) ) ;
11301115 let runtime_result = rt
11311116 . block_on ( bench_runtime (
11321117 connection,
11331118 runtime_suite,
1134- collector,
1119+ & collector,
11351120 BenchmarkFilter :: keep_all ( ) ,
11361121 DEFAULT_RUNTIME_ITERATIONS ,
11371122 ) )
0 commit comments