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

GoSublime: browse declarations and browse packages no response #757

Open
jackie-qiu opened this Issue Feb 22, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@jackie-qiu

jackie-qiu commented Feb 22, 2017

There is no response when execute GoSublime: browse declarations and GoSublime: browse packages.The MarGo is pending at the "fetching pkg dirs" status.
** 2017-02-22 12:19:41.466289 **:
GoSublime init r17.02.16-1 (0.001s)
| install margo: no
| install state: done
| sublime.version: 3126
| sublime.channel: stable
| about.ann: a17.02.16-1
| about.version: r17.02.16-1
| version: r17.02.16-1
| platform: osx-x64
| ~bin: ~/Library/Application Support/Sublime Text 3/Packages/User/GoSublime/osx-x64/bin
| margo.exe: ~bin/gosublime.margo_r17.02.16-1_go1.8.exe (ok)
| go.exe: /usr/local/opt/go/libexec/bin/go (ok)
| go.version: go1.8
| GOROOT: /usr/local/opt/go/libexec
| GOPATH: ~/Work/code/goroot
| GOBIN: (not set) (should usually be (not set))
| set.shell: []
| env.shell: /bin/zsh
| shell.cmd: ['/bin/zsh', '-l', '-c', '${CMD}']

image

@baloo32

This comment has been minimized.

baloo32 commented Nov 13, 2018

Same for me... just hangs.

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Nov 28, 2018

Is go list all also slow?

@baloo32

This comment has been minimized.

baloo32 commented Nov 30, 2018

go list all - 1 minute 14 seconds
GoSublime browse packages (Warm) - 8 seconds
GoSublime browse packages (Cold) - 2 minutes 13 seconds

So assume this is just the time it takes to parse the packages for first time.

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Dec 1, 2018

Thanks @baloo32, is there any way I might be able to reproduce this?

  • Do you have large repos in GOPATH? any that I can clone?
  • Do you have lots of non-go files e.g. node_modules?
  • EDIT: Is this on SSD, HDD?
  • EDIT: Roughly how many files are in GOPATH?

What's the slowest run of go list ./... inside GOROOT and each entry in GOPATH?
The current version of margo scans GOROOT and GOPATH in parallel so it should take only slightly longer than the slowest directory but I'm exploring faster ways to do said scanning before I port the package browsing over.

@baloo32

This comment has been minimized.

baloo32 commented Dec 5, 2018

GOPATH directory contains 49 different repos, including our main work project - only in our own do we have lots of no .go files - as suggested, bulk is node_modules (using Angular for front end).

Hosted on secondary SSD drive.

Files in GOPATH:
image
Files excluding the project with node_modules:
8,082 files, 3,077 folders
~178Mb

List of packages in use:
image

go list ./... in GOROOT = 39 seconds
go list ./... in GOPATH = 1 minute 8 seconds

Hope that helps.

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Dec 5, 2018

Thanks @baloo32.

For comparison:

Inside my GOROOT on Linux with i/o caches cleared I get ~5s from go list. Inside GOPATH with a lot of junk, go list is ~35s while my planned new solution using godirwalk is ~24s (~3s warm) with the actually directory traversal taking ~8s (~1.5s warm).

At the moment you can see the timings in the Sublime Text console at startup in line like margo:...Scan GOPATH...packages=123, list=12.3s. That timing is with go list so the planned solution will be faster and hopefully enables lazy loading of the package data which will also be cached so package browsing should take little to no extra time since many of the packages are already being loaded by autocompletion, etc.

We might also be able to speed it up more by skipping directories like node_modules.

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Dec 7, 2018

Update: the new code (still experimental, with little testing) is on the next branch. It's not being used yet, but it's running at startup and prints timings in the Sublime Text console like margocode.go: VFS.Scan.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment