Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance #19

Merged
merged 2 commits into from
Mar 6, 2020
Merged

Performance #19

merged 2 commits into from
Mar 6, 2020

Conversation

tkuhlman
Copy link

@tkuhlman tkuhlman commented Mar 4, 2020

No description provided.

This allows marking simple resolve functions as ones that should always avoid extra go routines
executor.go Outdated
@@ -33,7 +33,7 @@ func Execute(p ExecuteParams) (result *Result) {
ctx = context.Background()
}
if p.manager == nil {
p.manager = manager

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is messing with my mind -- where did this old value even come from that it worked?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops I thought I was fixing this for a test, I shouldn't have made that change in the main executor. I'm glad you pointed it out. To answer your question though it comes from https://github.com/GannettDigital/graphql/blob/master/graphql.go

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, the var ( being on a different line defeated my git grep-Fu by looking like a function use.

@@ -1041,7 +1045,7 @@ func TestNonNull_NullsTheTopLevelIfSyncNonNullableFieldErrors(t *testing.T) {
query Q { nonNullPromise }
`
expected := &graphql.Result{
Data: map[string]interface{}{"nonNullPromise": nil},
Data: nil,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that this changes the resulting data... hopefully that won't be an issue, since this only occurs on an error anyway.

@gannett-ggreer
Copy link

gannett-ggreer commented Mar 4, 2020

Biggest downside to this change is that both content-api-sport and content-api-election hand-roll many of their GraphQL structures and as such this is no benefit to those places without sprinkling ResolveSerial throughout all their graphql.Field like introspection.go does, which is gross.

@tkuhlman tkuhlman merged commit 33f6db0 into master Mar 6, 2020
@tkuhlman tkuhlman deleted the performance branch March 6, 2020 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants