Skip to content

Commit

Permalink
ui: add empty go.mod files to workspaces
Browse files Browse the repository at this point in the history
Some go tools such as go list end up traversing directories that don't
have go.mod files, looking for go packages.

If you happen to have built the UI recently, that means about tens of
thousands of extra stat calls.

On macOS, this is very expensive, even with warm caches.

For example:
```

time go list -modfile=go.mod -mod=readonly -e ARGS_ELIDED  -- builtin github.com/cockroachdb/cockroach/... > /dev/null 2>&1

real    0m28.309s
user    0m23.541s
sys     0m50.926s

> for i in pkg/ui/workspaces/*/; do touch $i/go.mod; done

> time go list -modfile=go.mod -mod=readonly -e ARGS_ELIDED -- builtin github.com/cockroachdb/cockroach/... > /dev/null 2>&1

real    0m13.074s
user    0m18.282s
sys     0m19.324s
```

The go list command I used was taken from what I observed gopls
running at startup.

On Linux, the impact relatively modest.

I could avoid building the UI, but I like the UI.

Epic: none

Release note: none
  • Loading branch information
stevendanna committed May 26, 2023
1 parent 7709f15 commit f17f546
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 0 deletions.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit f17f546

Please sign in to comment.