File tree Expand file tree Collapse file tree 8 files changed +16
-16
lines changed Expand file tree Collapse file tree 8 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ typed-arena = "2.0"
3131
3232[dev-dependencies ]
3333anyhow = " 1.0"
34- criterion = " 0.5.1 "
34+ criterion = " 0.6.0 "
3535expect-test = " 1.4"
3636notify = " 8.0.0"
3737pretty_assertions = " 1.3.0"
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ fn bench_many_identical_directives(c: &mut Criterion) {
1414 c. bench_function ( "many_same_directive" , move |b| {
1515 b. iter ( || {
1616 let result = Schema :: parse_and_validate ( & schema, "schema.graphqls" ) . unwrap ( ) ;
17- black_box ( result) ;
17+ std :: hint :: black_box ( result) ;
1818 } ) ;
1919 } ) ;
2020}
@@ -42,7 +42,7 @@ fn bench_many_identical_directives_query(c: &mut Criterion) {
4242 b. iter ( || {
4343 let result =
4444 ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
45- black_box ( result) ;
45+ std :: hint :: black_box ( result) ;
4646 } ) ;
4747 } ) ;
4848}
@@ -69,7 +69,7 @@ fn bench_many_invalid_directives_query(c: &mut Criterion) {
6969 b. iter ( || {
7070 let result = ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" )
7171 . expect_err ( "should have produced diagnostics" ) ;
72- black_box ( result) ;
72+ std :: hint :: black_box ( result) ;
7373 } ) ;
7474 } ) ;
7575}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ fn bench_many_same_field(c: &mut Criterion) {
1111 b. iter ( || {
1212 let doc =
1313 ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
14- black_box ( doc) ;
14+ std :: hint :: black_box ( doc) ;
1515 } ) ;
1616 } ) ;
1717}
@@ -31,7 +31,7 @@ fn bench_many_same_nested_field(c: &mut Criterion) {
3131 b. iter ( || {
3232 let doc =
3333 ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
34- black_box ( doc) ;
34+ std :: hint :: black_box ( doc) ;
3535 } ) ;
3636 } ) ;
3737}
@@ -51,7 +51,7 @@ fn bench_many_arguments(c: &mut Criterion) {
5151 b. iter ( || {
5252 // Will return errors but that's cool
5353 let doc = ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) ;
54- _ = black_box ( doc) ;
54+ _ = std :: hint :: black_box ( doc) ;
5555 } ) ;
5656 } ) ;
5757}
@@ -109,7 +109,7 @@ fn bench_many_types(c: &mut Criterion) {
109109 b. iter ( || {
110110 let doc =
111111 ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
112- black_box ( doc) ;
112+ std :: hint :: black_box ( doc) ;
113113 } ) ;
114114 } ) ;
115115}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fn bench_big_schema_many_fragments(c: &mut Criterion) {
4242 b. iter ( || {
4343 let doc =
4444 ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
45- black_box ( doc) ;
45+ std :: hint :: black_box ( doc) ;
4646 } ) ;
4747 } ) ;
4848}
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ use criterion::*;
66fn parse_ast ( schema : & str , query : & str ) {
77 let schema = Document :: parse ( schema, "schema.graphql" ) . unwrap ( ) ;
88 let doc = Document :: parse ( query, "query.graphql" ) . unwrap ( ) ;
9- black_box ( ( schema, doc) ) ;
9+ std :: hint :: black_box ( ( schema, doc) ) ;
1010}
1111
1212fn parse_and_validate ( schema : & str , query : & str ) {
1313 let schema = Schema :: parse_and_validate ( schema, "schema.graphql" ) . unwrap ( ) ;
1414 let doc = ExecutableDocument :: parse_and_validate ( & schema, query, "query.graphql" ) . unwrap ( ) ;
15- black_box ( ( schema, doc) ) ;
15+ std :: hint :: black_box ( ( schema, doc) ) ;
1616}
1717
1818fn bench_simple_query ( c : & mut Criterion ) {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ pretty_assertions = "1.3.0"
2929annotate-snippets = " 0.11.0"
3030expect-test = " 1.4"
3131unindent = " 0.2.1"
32- criterion = " 0.5 .0"
32+ criterion = " 0.6 .0"
3333
3434[[bench ]]
3535name = " query"
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn parse_query(query: &str) {
1919 . expect ( "the node SelectionSet is not optional in the spec; qed" ) ;
2020 for selection in selection_set. selections ( ) {
2121 if let cst:: Selection :: Field ( field) = selection {
22- black_box ( field. selection_set ( ) ) ;
22+ std :: hint :: black_box ( field. selection_set ( ) ) ;
2323 }
2424 }
2525 }
@@ -40,7 +40,7 @@ fn bench_query_lexer(c: &mut Criterion) {
4040 let lexer = Lexer :: new ( query) ;
4141
4242 for token_res in lexer {
43- black_box ( token_res. unwrap ( ) ) ;
43+ std :: hint :: black_box ( token_res. unwrap ( ) ) ;
4444 }
4545 } )
4646 } ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ fn parse_schema(schema: &str) {
2020 . fields_definition ( )
2121 . expect ( "the node FieldsDefinition is not optional in the spec; qed" ) ;
2222 for field in fields. field_definitions ( ) {
23- black_box ( field. ty ( ) ) ;
23+ std :: hint :: black_box ( field. ty ( ) ) ;
2424 }
2525 }
2626 }
@@ -42,7 +42,7 @@ fn bench_supergraph_lexer(c: &mut Criterion) {
4242 let lexer = Lexer :: new ( schema) ;
4343
4444 for token_res in lexer {
45- black_box ( token_res. unwrap ( ) ) ;
45+ std :: hint :: black_box ( token_res. unwrap ( ) ) ;
4646 }
4747 } )
4848 } ) ;
You can’t perform that action at this time.
0 commit comments