Re: [go-nuts] Opening network connections blocks system thread

2024-02-09 Thread Kurtis Rader
On Fri, Feb 9, 2024 at 2:10 PM Ian Lance Taylor wrote: > On Fri, Feb 9, 2024 at 11:57 AM Kurtis Rader wrote: > > > > The connect() syscall is normally blocking. It doesn't return until the > connection is established or an error occurs. It can be made non-blocking > by putting the file-descripto

Fwd: [go-nuts] [1.22] Is installing go under $HOME no longer possible?

2024-02-09 Thread Johana de Roxas
I just saw a big turn, that is the reason why to not do something about it. And not even say about it. And to not work even on it. -- Forwarded message - From: Tetsuo Handa Date: Sat, Feb 10, 2024, 8:59 AM Subject: [go-nuts] [1.22] Is installing go under $HOME no longer possible?

[go-nuts] Re: Profiling and PGO

2024-02-09 Thread 'qiulaidongfeng' via golang-nuts
Using benchmark and benchstat, you can compare the improvement obtained with PGO . On Friday, February 9, 2024 at 10:43:16 PM UTC+8 Agustin Horacio Urquiza Toledo wrote: > I’m trying to compare the efficiency of two binaries before and after > applying Profile-Guided Optimization . For this,

[go-nuts] [1.22] Is installing go under $HOME no longer possible?

2024-02-09 Thread Tetsuo Handa
I noticed that go 1.22 started emitting warning: GOPATH set to GOROOT ($HOME/go) has no effect and VSCode plugin noisily emits "Failed to run ..." messages due to this warning message). Although https://go.dev/doc/install suggests doing tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz an

[go-nuts] Re: v1.22.0 Performance Issues

2024-02-09 Thread Stephen Illingworth
Hi Michael, Thanks for looking at the profiles. I must confess that I didn't know about the --diff_base option. I'll take a closer look at the results of the diff and see if that can help me spot anything. In answer to your questions: I'm certain these profiles were produced from the same sour

Re: [go-nuts] Opening network connections blocks system thread

2024-02-09 Thread Ian Lance Taylor
On Fri, Feb 9, 2024 at 11:57 AM Kurtis Rader wrote: > > The connect() syscall is normally blocking. It doesn't return until the > connection is established or an error occurs. It can be made non-blocking by > putting the file-descriptor into non-blocking mode before the connect() call. > Howeve

Re: [go-nuts] Is there a way to cast interface to embedded type?

2024-02-09 Thread Mike Schinkel
> On Feb 9, 2024, at 3:37 PM, Christopher C > wrote: > > I have a base struct that implements an interface. There are multiple other > structs that embed this base struct. I would like to pass the an interface > into a function that can cast it as the base struct and call some functions > ti

Re: [go-nuts] Is there a way to cast interface to embedded type?

2024-02-09 Thread burak serdar
On Fri, Feb 9, 2024 at 1:37 PM Christopher C wrote: > > I have a base struct that implements an interface. There are multiple other > structs that embed this base struct. I would like to pass the an interface > into a function that can cast it as the base struct and call some functions > tied

[go-nuts] Is there a way to cast interface to embedded type?

2024-02-09 Thread Christopher C
I have a base struct that implements an interface. There are multiple other structs that embed this base struct. I would like to pass the an interface into a function that can cast it as the base struct and call some functions tied to the base struct. Something like this... https://go.dev/pla

[go-nuts] v1.22.0 Performance Issues

2024-02-09 Thread Stephen Illingworth
Hello, I'm trying v1.22.0 and I'm measuring an approximate drop in performance of 10%. I'm comparing to v1.21.7 I'm looking at the release notes but I can't see anything that I would think would be having an impact. Is anyone else noticing a performance drop? I've created a cpu.profile for my

Re: [go-nuts] Opening network connections blocks system thread

2024-02-09 Thread Kurtis Rader
The connect() syscall is normally blocking. It doesn't return until the connection is established or an error occurs. It can be made non-blocking by putting the file-descriptor into non-blocking mode before the connect() call. However, that then requires either an async callback or another syscall

[go-nuts] Opening network connections blocks system thread

2024-02-09 Thread Venkat T V
Hi, I am debugging an issue where a server opening a large number of connections on startup sometimes dies with "program exceeds 1-thread limit". I know file IO operations could lock up an OS thread. Still seeing this crash after eliminating file IO, and it looks like "syscall.connect" is

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread 'Brian Candler' via golang-nuts
Sorry you're right, it's "otool -L" for macOS. And you say that if you cross-compile from Linux with 1.22.0 to build a macOS binary, you get a size approx 93.8MB as well? Very odd. On Friday 9 February 2024 at 14:43:35 UTC cpu...@gmail.com wrote: > Yes, CGO is disabled. ldd doesn't seem to exis

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread cpu...@gmail.com
Yes, CGO is disabled. ldd doesn't seem to exist on MacOS: make build && ls -la ./evcc && otool -L ./evcc 1.21.7 CGO_ENABLED=0 go build -v -tags=release -trimpath -ldflags='-X github.com/evcc-io/evcc/server.Version=0.124.1 -X github.com/evcc-io/evcc/server.Commit=596071b42 -s -w' -rwxr-xr-x 1

[go-nuts] Profiling and PGO

2024-02-09 Thread Agustin Horacio Urquiza Toledo
I’m trying to compare the efficiency of two binaries before and after applying Profile-Guided Optimization . For this, I’m using Go’s profiling, specifically the flame graph. However, I’m getting two almost identical stacks; the only difference is that some functions are inlined. It seems tha

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread 'Brian Candler' via golang-nuts
Have you at any point set CGO_ENABLED=0 ? What does "ldd /path/to/binary" show on both the old (larger) and new (smaller) binaries? Maybe one is dynamically linked and the other statically linked? -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread cpu...@gmail.com
Just gave it another try cross-compiling to Arm on Linux. This time binary size stays the same. Sorry if my excitement was too premature. On Friday, February 9, 2024 at 2:11:25 PM UTC+1 cpu...@gmail.com wrote: > It's really surprising (positively). Compiling with -ldflags='-s -w' if > anyone wa

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread cpu...@gmail.com
It's really surprising (positively). Compiling with -ldflags='-s -w' if anyone wants to try this. On Friday, February 9, 2024 at 1:23:20 PM UTC+1 qiulaidongfeng wrote: > Quick search to find go1.22 as follows CL like > https://go-review.googlesource.com/c/go/+/521615 reduces binary size.

[go-nuts] Re: Go 1.22 binary size improvements?

2024-02-09 Thread 'qiulaidongfeng' via golang-nuts
Quick search to find go1.22 as follows CL like https://go-review.googlesource.com/c/go/+/521615 reduces binary size. However, from 93MB to 81MB, I think it is most likely the result of the joint efforts of many CLs. On Friday, February 9, 2024 at 7:46:48 PM UTC+8 cpu...@gmail.com wrote: >

[go-nuts] Go 1.22 binary size improvements?

2024-02-09 Thread cpu...@gmail.com
I was surprised to see my application (MacOS binary) go from 93MB to 81MB (no PGO). Release notes don't mention this. Has anyone made similar experience or knows why that is? Thanks, Andi -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

[go-nuts] What are the reason for the performance improvement cause by alloc data of different sizes to adjacent memory addresses?

2024-02-09 Thread 'qiulaidongfeng' via golang-nuts
I recently added a new API (AllocSoonUse) to the https://gitee.com/qiulaidongfeng/arena I wrote (copy in https://github.com/qiulaidongfeng/arena) This API allocdata to adjacent []byte, and the length can be set. I use this benchmark code : https://go.dev/play/p/nAGveraT5_h benchmark Brief descri