[go-nuts] Re: Need Help: gopls and VSCode Setup with the Go Project - Nested Module Error

2023-04-18 Thread 'Robert Findley' via golang-nuts
Hi, Yes, there are some gotchas involved with setting up VS Code with the Go project. The most common fix is to make sure that the go command resolved from PATH is the go command built via src/make.bash. There are some more details at https://github.com/golang/tools/blob/master/gopls/doc/adva

Re: [go-nuts] Reduce memory usage via reduced padding?

2023-04-18 Thread Def Ceb
> FYI, there is an existing tool that can detect structs where fields > could be rearranged. Interesting, I hadn't run into that before. > I don't think that one helps, as struct sizes are always increased to > be a multiple of the required struct alignment. Ah, this is true. I was working off

Re: [go-nuts] Reduce memory usage via reduced padding?

2023-04-18 Thread Ian Lance Taylor
On Tue, Apr 18, 2023 at 10:54 AM Def Ceb wrote: > > While working on a personal project, I noticed that quite a few structs in > the standard library, exported or otherwise, could have their memory > footprint reduced by simply reordering their members so that padding required > for alignment i

[go-nuts] finding the call graph of a method

2023-04-18 Thread Jochen Voss
Dear all, I'm trying to find the callgraph of a method, using the following code: package main import ( "log" "golang.org/x/tools/go/callgraph" "golang.org/x/tools/go/packages" "golang.org/x/tools/go/ssa/ssautil" ) func main() { cfg := &packages.Config{Mode: packages.LoadSyntax} initial, err :

[go-nuts] Re: Reduce memory usage via reduced padding?

2023-04-18 Thread Def Ceb
True, having it as a general compiler optimization and fiddling with many structs dealing with lower-level things are off-limits. And serialization via e.g encoding/binary is also a reason to avoid touching public fields. On Tuesday, April 18, 2023 at 6:26:27 PM UTC TheDiveO wrote: > The standa

[go-nuts] Re: Reduce memory usage via reduced padding?

2023-04-18 Thread TheDiveO
...would immediately *negatively affect* workhorses... On Tuesday, April 18, 2023 at 8:26:27 PM UTC+2 TheDiveO wrote: > The standard libraries in several parts define and also use structs where > the field ordering and padding is crucial as they are shared with operating > system functions. Try

[go-nuts] Re: Reduce memory usage via reduced padding?

2023-04-18 Thread TheDiveO
The standard libraries in several parts define and also use structs where the field ordering and padding is crucial as they are shared with operating system functions. Trying to rearrange fields in 3rd party apllications would immediately workhorses like Docker container engine, with associated

[go-nuts] Reduce memory usage via reduced padding?

2023-04-18 Thread Def Ceb
Hello. This is a request for comments on an idea I had. While working on a personal project, I noticed that quite a few structs in the standard library, exported or otherwise, could have their memory footprint reduced by simply reordering their members so that padding required for alignment is