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"
31
31
32
32
[dev-dependencies ]
33
33
anyhow = " 1.0"
34
- criterion = " 0.5.1 "
34
+ criterion = " 0.6.0 "
35
35
expect-test = " 1.4"
36
36
notify = " 8.0.0"
37
37
pretty_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) {
14
14
c. bench_function ( "many_same_directive" , move |b| {
15
15
b. iter ( || {
16
16
let result = Schema :: parse_and_validate ( & schema, "schema.graphqls" ) . unwrap ( ) ;
17
- black_box ( result) ;
17
+ std :: hint :: black_box ( result) ;
18
18
} ) ;
19
19
} ) ;
20
20
}
@@ -42,7 +42,7 @@ fn bench_many_identical_directives_query(c: &mut Criterion) {
42
42
b. iter ( || {
43
43
let result =
44
44
ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
45
- black_box ( result) ;
45
+ std :: hint :: black_box ( result) ;
46
46
} ) ;
47
47
} ) ;
48
48
}
@@ -69,7 +69,7 @@ fn bench_many_invalid_directives_query(c: &mut Criterion) {
69
69
b. iter ( || {
70
70
let result = ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" )
71
71
. expect_err ( "should have produced diagnostics" ) ;
72
- black_box ( result) ;
72
+ std :: hint :: black_box ( result) ;
73
73
} ) ;
74
74
} ) ;
75
75
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ fn bench_many_same_field(c: &mut Criterion) {
11
11
b. iter ( || {
12
12
let doc =
13
13
ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
14
- black_box ( doc) ;
14
+ std :: hint :: black_box ( doc) ;
15
15
} ) ;
16
16
} ) ;
17
17
}
@@ -31,7 +31,7 @@ fn bench_many_same_nested_field(c: &mut Criterion) {
31
31
b. iter ( || {
32
32
let doc =
33
33
ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
34
- black_box ( doc) ;
34
+ std :: hint :: black_box ( doc) ;
35
35
} ) ;
36
36
} ) ;
37
37
}
@@ -51,7 +51,7 @@ fn bench_many_arguments(c: &mut Criterion) {
51
51
b. iter ( || {
52
52
// Will return errors but that's cool
53
53
let doc = ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) ;
54
- _ = black_box ( doc) ;
54
+ _ = std :: hint :: black_box ( doc) ;
55
55
} ) ;
56
56
} ) ;
57
57
}
@@ -109,7 +109,7 @@ fn bench_many_types(c: &mut Criterion) {
109
109
b. iter ( || {
110
110
let doc =
111
111
ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
112
- black_box ( doc) ;
112
+ std :: hint :: black_box ( doc) ;
113
113
} ) ;
114
114
} ) ;
115
115
}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fn bench_big_schema_many_fragments(c: &mut Criterion) {
42
42
b. iter ( || {
43
43
let doc =
44
44
ExecutableDocument :: parse_and_validate ( & schema, & query, "query.graphql" ) . unwrap ( ) ;
45
- black_box ( doc) ;
45
+ std :: hint :: black_box ( doc) ;
46
46
} ) ;
47
47
} ) ;
48
48
}
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ use criterion::*;
6
6
fn parse_ast ( schema : & str , query : & str ) {
7
7
let schema = Document :: parse ( schema, "schema.graphql" ) . unwrap ( ) ;
8
8
let doc = Document :: parse ( query, "query.graphql" ) . unwrap ( ) ;
9
- black_box ( ( schema, doc) ) ;
9
+ std :: hint :: black_box ( ( schema, doc) ) ;
10
10
}
11
11
12
12
fn parse_and_validate ( schema : & str , query : & str ) {
13
13
let schema = Schema :: parse_and_validate ( schema, "schema.graphql" ) . unwrap ( ) ;
14
14
let doc = ExecutableDocument :: parse_and_validate ( & schema, query, "query.graphql" ) . unwrap ( ) ;
15
- black_box ( ( schema, doc) ) ;
15
+ std :: hint :: black_box ( ( schema, doc) ) ;
16
16
}
17
17
18
18
fn 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"
29
29
annotate-snippets = " 0.11.0"
30
30
expect-test = " 1.4"
31
31
unindent = " 0.2.1"
32
- criterion = " 0.5 .0"
32
+ criterion = " 0.6 .0"
33
33
34
34
[[bench ]]
35
35
name = " query"
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn parse_query(query: &str) {
19
19
. expect ( "the node SelectionSet is not optional in the spec; qed" ) ;
20
20
for selection in selection_set. selections ( ) {
21
21
if let cst:: Selection :: Field ( field) = selection {
22
- black_box ( field. selection_set ( ) ) ;
22
+ std :: hint :: black_box ( field. selection_set ( ) ) ;
23
23
}
24
24
}
25
25
}
@@ -40,7 +40,7 @@ fn bench_query_lexer(c: &mut Criterion) {
40
40
let lexer = Lexer :: new ( query) ;
41
41
42
42
for token_res in lexer {
43
- black_box ( token_res. unwrap ( ) ) ;
43
+ std :: hint :: black_box ( token_res. unwrap ( ) ) ;
44
44
}
45
45
} )
46
46
} ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ fn parse_schema(schema: &str) {
20
20
. fields_definition ( )
21
21
. expect ( "the node FieldsDefinition is not optional in the spec; qed" ) ;
22
22
for field in fields. field_definitions ( ) {
23
- black_box ( field. ty ( ) ) ;
23
+ std :: hint :: black_box ( field. ty ( ) ) ;
24
24
}
25
25
}
26
26
}
@@ -42,7 +42,7 @@ fn bench_supergraph_lexer(c: &mut Criterion) {
42
42
let lexer = Lexer :: new ( schema) ;
43
43
44
44
for token_res in lexer {
45
- black_box ( token_res. unwrap ( ) ) ;
45
+ std :: hint :: black_box ( token_res. unwrap ( ) ) ;
46
46
}
47
47
} )
48
48
} ) ;
You can’t perform that action at this time.
0 commit comments