[go-nuts] Re: [Potential Performance issue] Concurrent File upload time is linearly increasing; Need help

2023-01-25 Thread Brian Candler
I don't see any problem there. You've simply started 50 uploads concurrently, and some are completing sooner than others - most likely the ones which got first dibs on the CPU. This is because they're all fighting for the same resources - the CPU, the network, and especially the capacity on th

[go-nuts] %v display of nil map

2023-01-25 Thread Andrew Athan
I'm sure I'm not the first to say this, but here's my +1: It seems wrong to me that golang displays nil-valued reference types as an empty instance of the type with no indication that the reference is nil. E.g. ``` var m map[string]string fmt.Printf("%+v",m) ``` displays as "map[]" I think it

[go-nuts] Variable Declaration inside infinite loop

2023-01-25 Thread Shashwat
Is it safe to declare a variable inside an infinite loop ? for { a := 0 a += 1 } Won't this cause memory allocation in every iteration ? As the declared variables will be allocated memory in the stack and not heap memory, so garbage collector can't clear the allocated memory, and event

Re: [go-nuts] Variable Declaration inside infinite loop

2023-01-25 Thread 'Jakob Borg' via golang-nuts
On 25 Jan 2023, at 12:26, Shashwat wrote: > > Is it safe to declare a variable inside an infinite loop ? > > for { > a := 0 > a += 1 > } > > Won't this cause memory allocation in every iteration ? > > As the declared variables will be allocated memory in the stack and not heap > memor

Re: [go-nuts] %v display of nil map

2023-01-25 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2023-01-25 at 07:21 -0800, Andrew Athan wrote: > I'm sure I'm not the first to say this, but here's my +1: > > It seems wrong to me that golang displays nil-valued reference types > as an empty instance of the type with no indication that the > reference is nil. > > E.g. > ``` > var m map[s