Skip to content

Commit

Permalink
chore: adjust benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
erikwrede committed May 21, 2024
1 parent e02219a commit ae919f4
Showing 1 changed file with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions test_parser/benchmarks/test_core_full_schema_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __init__(self):


@pytest.mark.benchmark
def test_pycon_query_execution_graphql_core():
def test_full_graphql_core():
query = parse(operation)
validation_errors = validate(schema, query)
validation_success = not validation_errors
Expand All @@ -264,7 +264,7 @@ def test_pycon_query_execution_graphql_core():


@pytest.mark.benchmark
def test_pycon_query_execution_rustberry():
def test_full_rustberry():
document = compiler.parse(operation)
validation_success = compiler.validate(document)
query = compiler.gql_core_ast_mirror(document)
Expand All @@ -275,9 +275,35 @@ def test_pycon_query_execution_rustberry():
schema, query,
)
@pytest.mark.benchmark
def test_pycon_query_execution_rustberry_no_mirror():
def test_full_rustberry_no_mirror():
document = compiler.parse(operation)
validation_success = compiler.validate(document)
query = compiler.gql_core_ast(document)
if not validation_success:
return ExecutionResult(data=None, errors=validation_errors)

e = execute(
schema, query,
)


@pytest.mark.benchmark
def test_full_large_graphql_core():
query = parse(operation_large)
validation_errors = validate(schema, query)
validation_success = not validation_errors

if not validation_success:
return ExecutionResult(data=None, errors=validation_errors)

e = execute(
schema, query,
)

@pytest.mark.benchmark
def test_full_large_rustberry():
document = compiler.parse(operation_large)
validation_success = compiler.validate(document)
query = compiler.gql_core_ast_mirror(document)
if not validation_success:
return ExecutionResult(data=None, errors=validation_errors)
Expand All @@ -286,6 +312,18 @@ def test_pycon_query_execution_rustberry_no_mirror():
schema, query,
)

@pytest.mark.benchmark
def test_full_large_rustberry_no_mirror():
document = compiler.parse(operation_large)
validation_success = compiler.validate(document)
query = compiler.gql_core_ast(document)
if not validation_success:
return ExecutionResult(data=None, errors=validation_errors)

e = execute(
schema, query,
)

@pytest.mark.benchmark
def test_pure_execution_core(benchmark):
query = parse(operation)
Expand All @@ -310,13 +348,13 @@ def test_pure_execution_core_large(benchmark):
benchmark(execute, schema, query)

@pytest.mark.benchmark
def test_pure_execution_rustberry_large(benchmark):
def test_pure_execution_large_rustberry(benchmark):
document = compiler.parse(operation_large)
query = compiler.gql_core_ast_mirror(document)
benchmark(execute, schema, query)

@pytest.mark.benchmark
def test_pure_execution_rustberry_large_no_mirrpr(benchmark):
def test_pure_execution_large_rustberry_no_mirror(benchmark):
document = compiler.parse(operation_large)
query = compiler.gql_core_ast(document)
#print(print_ast(query))
Expand Down

0 comments on commit ae919f4

Please sign in to comment.