Re: [go-nuts] Some questions about GC and map[int]int

2023-11-23 Thread Kurtis Rader
You only need to ask for help once. You sent essentially the same message twice. Also, your example program doesn't provide any time for the GC to run in any meaningful manner as far as I can tell. So I am confused how your trivial program relates to a real world program. That is, while simple

[go-nuts] Some questions about GC and map[int]int, please help

2023-11-23 Thread 'Zhao Weng' via golang-nuts
Dear Gophers: I have some questions about GC and map[int]int, please help. consider the following program: ```go package main import ( "fmt" "os" "runtime/pprof" ) func main() { f, err := os.OpenFile("memory.pb.gz", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666 ) if err != nil { panic(err) } m :=

[go-nuts] Some questions about GC and map[int]int

2023-11-23 Thread 'Zhao Weng' via golang-nuts
Dear Gophers: I have some questions about GC and map[int]int, please help. consider the following program: ```go package main import ( "fmt" "os" "runtime/pprof" ) func main() { f, err := os.OpenFile("memory.pb.gz", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666 ) if err != nil { panic(err) } m :=

[go-nuts] Some questions about GC and map[int]int

2023-11-23 Thread 'Zhao Weng' via golang-nuts
Dear Gophers: I have some questions about GC and map[int]int, please help. consider the following program: ```go package main import ( "fmt" "os" "runtime/pprof" ) func main() { f, err := os.OpenFile("memory.pb.gz", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666 ) if err != nil { panic(err) } m :=

[go-nuts] Some question about GC and map[int]int

2023-11-23 Thread 'Zhao Weng' via golang-nuts
consider the following program: ```go package main import ( "fmt" "os" "runtime/pprof" ) func main() { f, err := os.OpenFile("memory.pb.gz", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666 ) if err != nil { panic(err) } m := make(map[int]int) for i := 0; i < 10e6; i++ { m[i] = 2 * i } if err :=

[go-nuts] Changing PWD ruins test caching

2023-11-23 Thread Kevin Burke
We have some tests that are pretty slow. I would like to use Go's test caching to skip them in our CI environment, if nothing in the code or the environment has changed. Our CI environment has a set of _agents_, each of which can run multiple jobs simultaneously. As a result, they check out

Re: [go-nuts] Go/Python interop

2023-11-23 Thread Sebastien Binet
On Thu Nov 23, 2023 at 15:23 CET, 'Michael Knyszek' via golang-nuts wrote: > Also, I'd like to clarify: > > - [David]: is it a good idea to use cgo for Go-Python interop? > - [Michael]: no. better with pipe or RPC > > I'm wrong about this. A conversation after the meeting clarified a >

Re: [go-nuts] a simple linux audio player pkg?

2023-11-23 Thread 'Mark' via golang-nuts
I just converted the []float32 to []byte (see function below) and it works. But the sound produced while recognizable is very staticy and I don't know why. func floats32ToBytes(fs []float32) []byte { var buf bytes.Buffer for _, f := range fs { if err := binary.Write(, binary.LittleEndian, f);

Re: [go-nuts] Go/Python interop

2023-11-23 Thread 'Michael Knyszek' via golang-nuts
Also, I'd like to clarify: - [David]: is it a good idea to use cgo for Go-Python interop? - [Michael]: no. better with pipe or RPC I'm wrong about this. A conversation after the meeting clarified a misunderstanding I had about Go->Python calls specifically. Both Go->Python and Python->Go with

Re: [go-nuts] a simple linux audio player pkg?

2023-11-23 Thread 'Mark' via golang-nuts
I've now tried using those libraries, but there seems to be an incompatibility []float32 vs []byte. Here's the error: ./play.go:24:29: cannot use reader (variable of type *oggvorbis.Reader) as io.Reader value in argument to otoCtx.NewPlayer: *oggvorbis.Reader does not implement io.Reader

Re: [go-nuts] Go/Python interop

2023-11-23 Thread Sebastien Binet
On Thu Nov 23, 2023 at 01:24 CET, Eli Bendersky wrote: > On Wed, Nov 22, 2023 at 11:31 AM Sebastien Binet > > wrote: > > > Hi there, > > > > In this week "compiler minutes" [1], one can read: > > > > """ > > - Go on future platforms (RAM efficiency. NUMA?) > > - (maybe) Go-Python interop for

Re: [go-nuts] a simple linux audio player pkg?

2023-11-23 Thread 'Mark' via golang-nuts
Thank you, I'll try them. (Well, for oto I'll try https://pkg.go.dev/github.com/hajimehoshi/oto/v2 since that seems to have more importers) On Wednesday, November 22, 2023 at 10:31:25 PM UTC Raffaele Sena wrote: > I have used github.com/jfreymuth/oggvorbis to read the ogg file (and > convert