Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
roeest committed Jun 25, 2024
1 parent daf1057 commit 93f2dfd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 287 deletions.
2 changes: 1 addition & 1 deletion _examples/benchmarking/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func BenchmarkQueriesOfVariableSizes(bmark *testing.B) {
{inputSize: 100000000, outputSize: 100000000},
} {
bmark.Run(fmt.Sprintf("input size: %d output size %d", testCase.inputSize, testCase.outputSize), func(b *testing.B) {
input := GenRandomString(testCase.inputSize)
input := generateStringOfSize(testCase.inputSize)

result := &struct {
Out models.OutputType `json:"testQueryPerformance"`
Expand Down
16 changes: 4 additions & 12 deletions _examples/benchmarking/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
### starwars example
### Benchmarking server

This server demonstrates a few advanced features of graphql:
- connections
- unions
- interfaces
- enums
This is used to allow you to return and receive json data with a specified size.

to run this server
```bash
go run ./server/server.go
```

and open http://localhost:8080 in your browser
It is meant to be used to test the performance of gqlgen's generated code when having to deal with
requests and responses of various sizes.
4 changes: 2 additions & 2 deletions _examples/benchmarking/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func (m *mutationResolver) TestMutationPerformance(_ context.Context, in models.
return &models.OutputType{Value: m.output}, nil
}

func GenRandomString(size int) string {
func generateStringOfSize(size int) string {
return strings.Repeat("a", size)
}

func NewResolver(outputSize int, expectedInput string) *Resolver {
return &Resolver{output: GenRandomString(outputSize), input: expectedInput}
return &Resolver{output: generateStringOfSize(outputSize), input: expectedInput}
}
30 changes: 0 additions & 30 deletions _examples/benchmarking/server/server.go

This file was deleted.

242 changes: 0 additions & 242 deletions _examples/benchmarking/starwars_test.go

This file was deleted.

0 comments on commit 93f2dfd

Please sign in to comment.