Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-12 Thread Rob Pike
Thanks for the tip. A fairly straightforward implementation of this algorithm gives me about a factor of two speedup for pretty much any value. I went up to 1e8!, which took about half an hour compared to nearly an hour for MulRange. I'll probably stick in ivy after a little more tuning. I may

Re: [go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Rochus Keller
> Something like this? https://go.dev/play/p/_H3kFjprAGG No, sorry. The goal is to emulate a full monitor just with channels, as demonstrated in the referenced text (see the Stack example). The Mutex is likely correct, but the Signal has yet to pass the scrutinity of the folks here. -- You

Re: [go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 7:57 PM Rochus Keller wrote: > Here is the full question with examples (though meanwhile closed as usual in > recent times on stackoverflow, so answer here please): >

[go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Rochus Keller
Here is the full question with examples (though meanwhile closed as usual in recent times on stackoverflow, so answer here please): https://stackoverflow.com/questions/77802102/mutex-and-condition-variables-in-go-without-using-the-sync-package This is a conceptual question based on the duality

Re: [go-nuts] Re: Rendering fonts in Go

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 12:34 PM 'Brian Candler' via golang-nuts wrote: > At worst, it may possible to compile C into Go. It sounds mad, but I believe > SQLite has been ported to pure Go this way. Challenge accepted: https://pkg.go.dev/modernc.org/libfreetype -- You received this message

[go-nuts] pauseEnd times in runtime.Memstats

2024-01-12 Thread Michael Mitchell
In runtime.Memstates, one of the stats given is the timestamps for the last 256 garbage collections in the PauseEnd array, i.e. when those garbage collections took place. So if you subtract one timestamp from another, you can find out how much time took place between garbage collections. Is

[go-nuts] Re: Rendering fonts in Go

2024-01-12 Thread 'Brian Candler' via golang-nuts
At worst, it may possible to compile C into Go. It sounds mad, but I believe SQLite has been ported to pure Go this way. https://pkg.go.dev/modernc.org/sqlite https://twitter.com/bradfitz/status/855271867162083329?lang=en https://groups.google.com/g/golang-nuts/c/QDEczMhlQBU/m/4lCn2kP0AwAJ