Why does x/tools/go/packages use `go list` under the hood?
82 views
Skip to first unread message
Matt Mueller
unread,
Aug 17, 2020, 5:22:52 PM8/17/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi folks,
I was looking into where my packages.Load time was being spent and I noticed that under the hood the packages library calls out to "go list" for information.
I'm just wondering if there's any specific reason for this? It seems like fairly low-hanging fruit performance-wise to not spawn additional processes.
Thanks!
Matt
Matt Mueller
unread,
Aug 17, 2020, 5:34:03 PM8/17/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
I think I got it. It looks like `go list` uses an internal cache to make its use really fast. Hopefully this package gets merged into the stdlib and we can take advantage of the cache directly!