-
Notifications
You must be signed in to change notification settings - Fork 2
Alternative concurrent evaluation of fields #21
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
Alternative concurrent evaluation of fields #21
Conversation
Hey @andreas Thanks for the PR, appreciate it very much 👍 Regarding the use of mutex for Cheers! |
… from here for perf-related PRs. - simple hello world equivalent - with a list - deeper query with list - query with many root fields and list in each of them - deeper query with many root fields and lists To really bring out probable issues with query perf, a latency is introduced to the data retrieval (previously it was just in-memory data fetch) When testing against branch before PR #20 and #21, this really highlighted the problem with evaluating list fields. In the future, more benchmarks for queries with fragments probably would be useful.
Sorry for lurking, but any idea when parallel resolves might make it into master? I tried compiling the experiment-parallel-resolve branch unsuccessfully:
Any idea what I'm doing wrong? Give me some pointers and maybe I can help solve it. |
@Nebulai, the following works for me: git clone https://github.com/sogko/graphql.git
cd graphql
git checkout origin/sogko/experiment-parallel-resolve
go build How did you get that error? |
@andreas Got it working now I had an old version of go-graphql. Pulled the latest one and just had this one error:
Changed line 37 to how it looks in the go-graphql master and that did the trick 👍 |
This is another take on doing concurrent evaluation of fields. Not necessarily better, but maybe it can serve as inspiration. The goroutines assign directly into the result map, which (unfortunately) needs to be protected by a mutex, as maps are not thread-safe. A separate channel
panics
is used for re-raising panics.