Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
99775: ui: add empty go.mod files to workspaces r=knz a=stevendanna

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 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

Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
craig[bot] and stevendanna committed May 30, 2023
2 parents 3cce075 + f17f546 commit 48c2bc6
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 48c2bc6

Please sign in to comment.