Skip to content

Commit 5f501ec

Browse files
committed
Measure print/visit performance
Note that the performance was already optimized in Python. Replicates graphql/graphql-js@31bf28f4
1 parent 001abd9 commit 5f501ec

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎tests/benchmarks/test_print.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from graphql import parse, print_ast
2+
3+
from ..fixtures import kitchen_sink_query # noqa: F401
4+
5+
6+
def test_print_kitchen_sink(benchmark, kitchen_sink_query): # noqa: F811
7+
document = parse(
8+
kitchen_sink_query, experimental_client_controlled_nullability=True
9+
)
10+
result = benchmark(lambda: print_ast(document))
11+
assert isinstance(result, str)

0 commit comments

Comments
 (0)