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

make gqlgen generate 10x faster in some projects #707

Merged
merged 1 commit into from
May 14, 2019

Conversation

vektah
Copy link
Collaborator

@vektah vektah commented May 12, 2019

Theres a horrible performance stall (~3 seconds per call) when trying to look up package data for empty directories. There must be some more conditions to it, because I don't see it when working inside gqlgen, only when using gqlgen in other apps via go modules.

Might be related to golang/go#29427, I am using protobuffers which I think has a cgo component.

In this PR I've removed x/tools/packages use when doing simple dir -> package lookups, doing the file system traversal to find a mod file in this direction is trivial.

For one of my small projects this takes the time to generate down from 25.17s to 2.57s

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@vektah vektah merged commit eaa61bb into master May 14, 2019
@vektah vektah deleted the gomodules-performance branch May 14, 2019 11:17
@vektah vektah added the v0.9 Fixed in 0.9.0 label May 15, 2019
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
make gqlgen generate 10x faster in some projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.9 Fixed in 0.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant