Re: [go-nuts] Allocating lots (e.g. a million) objects on the heap

2020-07-22 Thread Jesper Louis Andersen
On Mon, Jul 20, 2020 at 7:34 PM wrote: > I have an application where I will be allocating millions of data > structures, all of the same size. My program will need to run continuously > and be pretty responsive to > its network peers. > > I'd recommend quantifying "pretty responsive" in this case

Re: [go-nuts] Allocating lots (e.g. a million) objects on the heap

2020-07-20 Thread Robert Engels
All you are doing is replicating manual memory management. If you are going to do that just use CGo with malloc & free so you will have decent debugging. If not, don’t do this at all and let the GC do its work (but Go lack of a generational GC might be an issue here). > On Jul 20, 2020, at 12

Re: [go-nuts] Allocating lots (e.g. a million) objects on the heap

2020-07-20 Thread Jan Mercl
Check https://godoc.org/modernc.org/memory, maybe it can be used in this scenario. Note, using the package concurrently from multiple goroutines requires coordination, like with a mutex. On Mon, Jul 20, 2020, 19:35 wrote: > I have an application where I will be allocating millions of data > stru

[go-nuts] Allocating lots (e.g. a million) objects on the heap

2020-07-20 Thread netconnect . mary
I have an application where I will be allocating millions of data structures, all of the same size. My program will need to run continuously and be pretty responsive to its network peers. The data is fairly static, once allocated it will rarely need to be modified or deleted. In order to mini