[go-nuts] Re: What is the behavior of an HTTP persistent connection in Go?

2018-08-20 Thread golangnutter
Also do you have any recommendations for deriving appropriate values for Transport.MaxIdleConns or Transport.MaxIdleConnsPerHost? On Monday, August 20, 2018 at 12:59:07 AM UTC-7, golang...@gmail.com wrote: > > The http.Transport caches connections for future re-use >

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread keith . randall
There is no conservativeness to unsafe.Pointer. The type information for any object in the heap is recorded at allocation time, and is unrelated to the type of the reference currently held to it (be it unsafe.Pointer, []byte, *int64, or whatever). So for 2.2, the answer is no, you are

Re: [go-nuts] internal compilation error while compiling gccgo from source solaris 10

2018-08-20 Thread Ian Lance Taylor
On Sun, Aug 19, 2018 at 9:39 PM, Amandeep Gautam wrote: > gmake[3]: Entering directory > '/export/home/amandeep/gccgo-obj/sparc-sun-solaris2.10/libgo' > gmake[4]: Entering directory > '/export/home/amandeep/gccgo-obj/sparc-sun-solaris2.10/libgo' > /opt/csw/bin/gmkdir -p .; files=`echo >

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Kevin Malachowski' via golang-nuts
That information is old now - Go has a precise GC now. There is some sort of metadata stored for each variable related to whether the type contains pointers (as Jan alluded to earlier in the thread). On Monday, August 20, 2018 at 7:28:51 AM UTC-7, Florian Uekermann wrote: > > From the GC POV,

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Florian Uekermann' via golang-nuts
> > From the GC POV, the only interesting thing about an unsafe.Pointer is if > its value falls anywhere into a GC managed memory block for liveness > analysis, AFAIK. > And then it will check that memory block for stuff that looks like a pointer (not caring what the actual type being pointed

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread Jan Mercl
On Mon, Aug 20, 2018 at 3:48 PM 'Florian Uekermann' via golang-nuts < golang-nuts@googlegroups.com> wrote: >> The garbage collector does not care about the values of items of a []T when T is not a pointer type nor a type containing transitively any pointers. > > Just to make sure I understand

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Florian Uekermann' via golang-nuts
> > The garbage collector does not care about the values of items of a []T > when T is not a pointer type nor a type containing transitively any > pointers. > Just to make sure I understand you correctly. Are you saying I could hold an unsafe.Pointer to an array of uint64 and the GC will still

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread Jan Mercl
On Mon, Aug 20, 2018 at 2:49 PM 'Florian Uekermann' via golang-nuts < golang-nuts@googlegroups.com> wrote: > ... which would put unnecessary strain on the GC iirc, because the memory pointed to would be scanned conservatively (basically assuming everything in there could be a pointer). The

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Florian Uekermann' via golang-nuts
Thanks Axel. Good to know the first part. I have a couple of comments regarding your answer to the second part. In regards to your second question: That would require having an array type > for every possible size, which isn't really tenable. > The idea was to use the same array type

Re: [go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Axel Wagner' via golang-nuts
I'm not 100% sure, but… pretty sure? that the GC does not look at the len/cap fields of slices. Reason being that that would require significant alias-analysis, as two slices of the same underlying array can have different lengths and capacities. So treating the underlying array not as "one

[go-nuts] Re: Garbage collector and Slices

2018-08-20 Thread 'Florian Uekermann' via golang-nuts
Mistake in the second struct. The data field should have the type: *[(^uint(0)) >> 17]uint64 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Garbage collector and Slices

2018-08-20 Thread 'Florian Uekermann' via golang-nuts
Dear all, I have some questions concerning the implementation details of the garbage collector regarding slices and arrays. I'm implementing bit slices. The current approach is to use the following struct: type BitSlice { data []uint64 len int } Given that the slices length and capacity are

[go-nuts] Re: Function not working like I think it should?

2018-08-20 Thread rob . shelby
That was it. Thanks! On Saturday, August 18, 2018 at 10:27:25 PM UTC-4, rob.s...@team-rehab.com wrote: > > Hi all! I'm hoping any of you could checkout my Golang question on Stack? > > https://stackoverflow.com/questions/51911363/passing-results-in-go-and-wxgo > > I really didn't know what to

[go-nuts] Re: Confusion between Pointer or No Pointer for Nested array struct

2018-08-20 Thread Tamás Gulácsi
It depends. For values (no pointers) that 40 may be slower to copy than the dereference of the pointer. But pointers allow modifications, so the extra cost may be balanced by the gained safety and less headache. And less nil pointers. -- You received this message because you are subscribed to

Re: [go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-20 Thread Dave Cheney
Thanks for confirming this is a regression. On 20 August 2018 at 18:41, Shulhan wrote: > On Sun, 19 Aug 2018 16:13:00 -0700 (PDT) > Dave Cheney wrote: > >> Point of clarification, the package name doesn’t contain a dot, that >> is not permitted by the syntax of the package declaration. The name

Re: [go-nuts] [Bug?] Error when running "go tool cover" on package name contains dot

2018-08-20 Thread Shulhan
On Sun, 19 Aug 2018 16:13:00 -0700 (PDT) Dave Cheney wrote: > Point of clarification, the package name doesn’t contain a dot, that > is not permitted by the syntax of the package declaration. The name > of the directory you placed the file in ends in .go and this is > confusing the tool. >

[go-nuts] What is the behavior of an HTTP persistent connection in Go?

2018-08-20 Thread golangnutter
The http.Transport caches connections for future re-use https://golang.org/pkg/net/http/#Transport Are requests sent serially by which I mean only one request and response can be handled by this persistent connection at a time, so that other concurrent requests to the same host are blocked

[go-nuts] Re: Confusion between Pointer or No Pointer for Nested array struct

2018-08-20 Thread R Sharma
Hi Tamás Gulácsi If my User struct has 40 fields, will the decision be still the same? I minified my `User` struct. It has 40 fields like "city,state,country, address,email,IP,ua,status,verified.etc.," Will still `Case B` is better? -- You received this message because you are