Giter Site home page Giter Site logo

Comments (13)

stamblerre avatar stamblerre commented on July 30, 2024 1

The cache will fallback to -source if it can't find anything. You can generate those cache files by running go install -i <package>. You can also try out gopls for faster autocompletion (more info).

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@jdevelop: how large is your project?

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

@stamblerre https://github.com/jdevelop/musicshare

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

Is there any possibility that your editor is setting the -source flag? I tried to reproduce this, and the slowest time I got was 24ms for the same completion. I know that Vim has a gocode_propose_source setting--is it possible you are setting that?

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

Interesting! I updated to master and then ran GoUpdateBinaries - and everything works fast now on Arch Linux now.

pgrep -af gocode
9286 /home/user/go/bin/gocode -s -sock unix -addr 127.0.0.1:37373 -cache

However given the MacPro'15 with exactly the same setup and the gocode server running with exactly the same arguments on the same project - the completion is very slow still.

Is there any difference between OSX / Linux versions?

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

Hm, I have heard about Macs being slower than Linux, specifically in the case of the go command (golang/go#28739). I'll try to reproduce this on my Mac later today.

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

I tried with the fresh environment and master branches of vim-go and gocode, so far I feel that there is some small delay on MacOS, but I can't really point it out.

I guess that we can close this one for the moment.

Thanks for the help!

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

For some reason it stopped working after the most recent updates. The command line for the completion in vim:

/home/user/go/bin/gocode -sock unix -f vim -builtin -fallback-to-source -cache autocomplete /home/user/go/src/github.com/meetmaps/app/cli/main.go

I wonder where the cache is located? Any chance that it rolls back to source?

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

vim-go: 66d06f380ef3cbced060b4d514413762a4438fb4
gocode: 7fb65232883f19a8305706b4b4ff32916ffbcaf5

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

Looks like it can't read things from cache:

2019/03/09 20:40:23 cache: importing: time, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: importing: github.com/meetmaps, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: no gcexportdata file for github.com/meetmaps
2019/03/09 20:40:23 cache: cache: falling back to the source importer for github.com/meetmaps
2019/03/09 20:40:23 cache: importing: github.com/meetmaps/queue, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: no gcexportdata file for github.com/meetmaps/queue
2019/03/09 20:40:23 cache: cache: falling back to the source importer for github.com/meetmaps/queue
2019/03/09 20:40:24 cache: importing: github.com/meetmaps/storage, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:24 cache: no gcexportdata file for github.com/meetmaps/storage
....
2019/03/09 20:40:29 Elapsed duration: 5.523123152s

How can I generate those cache files?

from gocode.

jdevelop avatar jdevelop commented on July 30, 2024

Looks like this could be related to the different caching in go1.12 - the pkg folder doesn't have the updates from the codebase. I tried @stamblerre version from github.com/stamblerre/gocode and it works considerably better, but still yielding

2019/03/09 21:38:48 Elapsed duration: 1.209366734s

which is quite too long

from gocode.

FuzzOli87 avatar FuzzOli87 commented on July 30, 2024

@stamblerre How can we use this gopls feature?

from gocode.

stamblerre avatar stamblerre commented on July 30, 2024

@FuzzOli87: gopls is a replacement for gocode that is currently in alpha. Installation is explained on this Wiki page: https://github.com/golang/go/wiki/gopls.

from gocode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.