@@ -7,7 +7,7 @@ use tokio::runtime::Runtime;
77use tokio_postgres:: { Client , NoTls } ;
88
99fn setup ( ) -> ( Client , Runtime ) {
10- let runtime = Runtime :: new ( ) . unwrap ( ) ;
10+ let mut runtime = Runtime :: new ( ) . unwrap ( ) ;
1111 let ( client, conn) = runtime
1212 . block_on ( tokio_postgres:: connect (
1313 "host=localhost port=5433 user=postgres" ,
@@ -19,7 +19,7 @@ fn setup() -> (Client, Runtime) {
1919}
2020
2121fn query_prepared ( c : & mut Criterion ) {
22- let ( client, runtime) = setup ( ) ;
22+ let ( client, mut runtime) = setup ( ) ;
2323 let statement = runtime. block_on ( client. prepare ( "SELECT $1::INT8" ) ) . unwrap ( ) ;
2424 c. bench_function ( "runtime_block_on" , move |b| {
2525 b. iter ( || {
@@ -29,13 +29,13 @@ fn query_prepared(c: &mut Criterion) {
2929 } )
3030 } ) ;
3131
32- let ( client, runtime) = setup ( ) ;
32+ let ( client, mut runtime) = setup ( ) ;
3333 let statement = runtime. block_on ( client. prepare ( "SELECT $1::INT8" ) ) . unwrap ( ) ;
3434 c. bench_function ( "executor_block_on" , move |b| {
3535 b. iter ( || executor:: block_on ( client. query ( & statement, & [ & 1i64 ] ) ) . unwrap ( ) )
3636 } ) ;
3737
38- let ( client, runtime) = setup ( ) ;
38+ let ( client, mut runtime) = setup ( ) ;
3939 let client = Arc :: new ( client) ;
4040 let statement = runtime. block_on ( client. prepare ( "SELECT $1::INT8" ) ) . unwrap ( ) ;
4141 c. bench_function ( "spawned" , move |b| {
0 commit comments