11// This file defines the common functions used by the benchmarks.
22// Dead code is allowed as it is only used when compiling benchmarks.
33
4- use std:: collections:: BTreeMap ;
54use std:: rc:: Rc ;
65
76use crate :: LOLASpecification ;
87use crate :: Value ;
9- use crate :: VarName ;
108use crate :: core:: AbstractMonitorBuilder ;
119use crate :: core:: OutputHandler ;
1210use crate :: core:: Runnable ;
@@ -29,7 +27,7 @@ pub async fn monitor_runtime_outputs(
2927 semantics : Semantics ,
3028 executor : Rc < LocalExecutor < ' static > > ,
3129 spec : LOLASpecification ,
32- input_values : BTreeMap < VarName , Vec < Value > > ,
30+ input_provider : MapInputProvider ,
3331 output_limit : Option < usize > ,
3432) {
3533 let output_handler: Box < dyn OutputHandler < Val = Value > > = match output_limit {
@@ -44,8 +42,6 @@ pub async fn monitor_runtime_outputs(
4442 ) ) ,
4543 } ;
4644
47- let input_provider = MapInputProvider :: new ( input_values) ;
48-
4945 let monitor = RuntimeBuilder :: new ( )
5046 . runtime ( runtime)
5147 . semantics ( semantics)
@@ -60,15 +56,15 @@ pub async fn monitor_runtime_outputs(
6056pub async fn monitor_outputs_untyped_async_limited (
6157 executor : Rc < LocalExecutor < ' static > > ,
6258 spec : LOLASpecification ,
63- input_values : BTreeMap < VarName , Vec < Value > > ,
59+ input_provider : MapInputProvider ,
6460 limit : usize ,
6561) {
6662 monitor_runtime_outputs (
6763 Runtime :: Async ,
6864 Semantics :: Untimed ,
6965 executor,
7066 spec,
71- input_values ,
67+ input_provider ,
7268 Some ( limit) ,
7369 )
7470 . await ;
@@ -77,7 +73,7 @@ pub async fn monitor_outputs_untyped_async_limited(
7773pub async fn monitor_outputs_untyped_async (
7874 executor : Rc < LocalExecutor < ' static > > ,
7975 spec : LOLASpecification ,
80- input_values : BTreeMap < VarName , Vec < Value > > ,
76+ input_values : MapInputProvider ,
8177) {
8278 monitor_runtime_outputs (
8379 Runtime :: Async ,
@@ -93,14 +89,14 @@ pub async fn monitor_outputs_untyped_async(
9389pub async fn monitor_outputs_untyped_little (
9490 executor : Rc < LocalExecutor < ' static > > ,
9591 spec : LOLASpecification ,
96- input_values : BTreeMap < VarName , Vec < Value > > ,
92+ input_provider : MapInputProvider ,
9793) {
9894 monitor_runtime_outputs (
9995 Runtime :: SemiSync ,
10096 Semantics :: Untimed ,
10197 executor,
10298 spec,
103- input_values ,
99+ input_provider ,
104100 None ,
105101 )
106102 . await ;
@@ -118,15 +114,14 @@ impl AsyncConfig for ConfigTyped {
118114pub async fn monitor_outputs_typed_async (
119115 executor : Rc < LocalExecutor < ' static > > ,
120116 spec : TypedLOLASpecification ,
121- input_values : BTreeMap < VarName , Vec < Value > > ,
117+ input_provider : MapInputProvider ,
122118) {
123119 // Currently cannot be deduplicated since it includes the type
124120 // checking
125121 let output_handler = Box :: new ( NullOutputHandler :: new (
126122 executor. clone ( ) ,
127123 spec. output_vars . clone ( ) ,
128124 ) ) ;
129- let input_provider = MapInputProvider :: new ( input_values) ;
130125 let async_monitor = AsyncMonitorBuilder :: <
131126 _ ,
132127 ConfigTyped ,
0 commit comments