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

cache packages to improve speed #71

Merged
merged 18 commits into from Oct 16, 2018

Conversation

@stamblerre
Copy link
Collaborator

commented Oct 16, 2018

Merge the caching branch into master. The cache branch reads export data files and caches them. If no export data is available, the cache importer falls back to the source importer, and it caches its results for a certain limited amount of time (20 minutes now, can be changed). The cache importer works with packages in a gb layout. If the -source flag is specified, the original gbimporter with the underlying source importer is used. Future work would involve merging these two importers, as there is a bit of duplicated code here.

mdempsky added 3 commits May 2, 2018
WORK IN PROGRESS

This doesn't support -source or gb build layouts.
@Contextualist

This comment has been minimized.

Copy link

commented on dd2ac12 May 5, 2018

Could you please make the CacheImporter a separate package or incorporate it into package gbimporter so that it is more reusable?

This comment has been minimized.

Copy link
Owner Author

replied May 5, 2018

@Contextualist Can you share the greater context of why you're interested in that?

This comment has been minimized.

Copy link
Owner Author

replied May 5, 2018

In case this is because you're interested in using mdempsky/gocode in sourcegraph/go-langserver, I think there's a much better way to accomplish that. It looks like go-langserver already has a caching mechanism for loader.Programs? Then this is just an unnecessary level of abstraction and complexity.

I think it would be better to generate suggestions from the same cached type information go-langserver uses to implement hover/definition/etc.

@stamblerre stamblerre requested a review from ianthehat Oct 16, 2018
Copy link
Collaborator

left a comment

Seems reasonable.

@stamblerre stamblerre merged commit 22f3bf7 into master Oct 16, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@stamblerre stamblerre deleted the cache branch Oct 16, 2018
@ramya-rao-a

This comment has been minimized.

Copy link

commented Oct 16, 2018

@stamblerre This is independent of the -source flag correct? Editors need not do any changes other than users updating their gocode, right?

@stamblerre

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 16, 2018

@ramya-rao-a, yeah this is just an improvement to gocode. The -source flag should still work as it did previously. Let me know if you encounter any bugs, but it shouldn't change anything (except for hopefully improve speed!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.