Re: [go-nuts] Why is the error sent to original channel can still be received after recreating the channel?

2024-09-19 Thread robert engels
Because the channel is captured by reference, so when the Go routine runs it already has the later value. Your code has a race condition - run it under the race detector. > On Sep 19, 2024, at 11:30 AM, Feng Liyuan (SunRunAway) > wrote: > > I have a piece of Go code where I create a buffered

Re: [go-nuts] io.Copy(conn, os.Stdin) do not work as expected

2024-09-19 Thread Robert Engels
Also, it would be simpler to not run the copy in a go routine until you verify that is working as expected. Then use wait groups to control the go routine lifecycle. On Sep 19, 2024, at 8:51 AM, Robert Engels wrote:Are you certain you are running it in a terminal that has stdin available for

Re: [go-nuts] io.Copy(conn, os.Stdin) do not work as expected

2024-09-19 Thread Robert Engels
Are you certain you are running it in a terminal that has stdin available for reading?On Sep 19, 2024, at 8:08 AM, 李世民 wrote:The details as following link:https://stackoverflow.com/questions/78996496/io-copyconn-os-stdin-do-not-work-as-expected#comment139289803_78996496Please help me identify whe

Re: [go-nuts] Re: Can we suggest to the GC that I think this memory can be reclaimed?

2024-09-16 Thread Robert Engels
With Go there is no possibility of use after free unless you use unsafe calls. On Sep 16, 2024, at 10:47 AM, Kevin Chowski wrote:In particular, since Go has a goal of avoiding use-after-free bugs, the GC would have to do the same validation it is doing anyway to double-check that the caller is no

Re: [go-nuts] http resp.Write & httputil.DumpResponse include extra text with body

2024-09-13 Thread Robert Engels
If you set the content length in the header it should turn off chunked encoding. On Sep 13, 2024, at 8:38 AM, Peter Galbavy wrote:Makes sense and good to know, but for diag output is there any way to turn it off?On Friday 13 September 2024 at 14:25:19 UTC+1 Eli Lindsey wrote:Those are sizes from

Re: [go-nuts] Dereferencing struct field triggers heap allocation for the complete struct

2024-08-30 Thread Robert Engels
.RunParallel(func(pb *testing.PB) { for pb.Next() { scanY(printKey,Y{ key: "root", children: []Y{ { key:      "level1", children: nil, }, },}, ) } })}On Saturday, August 31, 2024 at 5:02:28 AM UTC+12 robert engels wrote:because when you

Re: [go-nuts] Dereferencing struct field triggers heap allocation for the complete struct

2024-08-30 Thread robert engels
because when you only access an int that is passed by value in the function it knows it can’t escape. if you pass the string/value than the the variable can escape, and since the value could point back to the struct itself, it can escape, meaning the entire struct needs to be on the heap. > O

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-27 Thread robert engels
and/or would not know how to add runtime options to work around it. > On Aug 27, 2024, at 11:06 AM, Creaky wrote: > > > > On Tuesday, August 27, 2024 at 8:00:27 AM UTC+10 robert engels wrote: > I don’t think being concerned about the user is correct - I suspect that many

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-26 Thread robert engels
Hi, Isn’t the version release notes sufficient? Maybe add a "breaking changes" section? https://tip.golang.org/doc/go1.23 > On Aug 26, 2024, at 4:20 PM, Ian Lance Taylor wrote: > > On Mon, Aug 26, 2024 at 8:31 AM Creaky wrote: >> >> Want to discuss the impacts from the implementation of the

Re: [go-nuts] Deallocate memory consumption of slice.

2024-08-26 Thread robert engels
But why would you want to allocate a new array? This would only be required if the MongoDB call were async, and the array cannot be reused. If you keep allocating new arrays you are putting needless pressure on the GC. > On Aug 26, 2024, at 11:18 AM, Marvin Renich wrote: > > * Gowtham Raj mail

Re: [go-nuts] Slice of interfaces taking up so much memory

2024-08-26 Thread robert engels
10:48 AM, robert engels wrote: > > actually, change it to models = models[0:0], not models=models[0:0:0], > otherwise you are causing new arrays to be allocated on each loop. > >> On Aug 26, 2024, at 10:45 AM, robert engels > <mailto:reng...@ix.netcom.com>> wrote:

Re: [go-nuts] Slice of interfaces taking up so much memory

2024-08-26 Thread robert engels
actually, change it to models = models[0:0], not models=models[0:0:0], otherwise you are causing new arrays to be allocated on each loop. > On Aug 26, 2024, at 10:45 AM, robert engels wrote: > > It is working as expected. You allocate models to hold 10k elements - you > never p

Re: [go-nuts] Slice of interfaces taking up so much memory

2024-08-26 Thread robert engels
It is working as expected. You allocate models to hold 10k elements - you never put more than 10k elements in it, so it will not consume additional memory. (You should probably make the comparison == 1, not > 1 to avoid the extra array allocation. GC is non deterministic - so it will on

Re: [go-nuts] gc: optimize JMP to RET instructions

2024-08-14 Thread robert engels
of these cases are when JMP leads to RET > inside on function, so indeed this optimization will have almost zero effect. > But if RET instruction appears to be far enough, I guess this optimization > can be meaningful. > > On Wednesday 14 August 2024 at 19:40:22 UTC+3 robert enge

Re: [go-nuts] gc: optimize JMP to RET instructions

2024-08-14 Thread robert engels
Won’t the speculative/parallel execution by most processors make the JMP essentially a no-op? See https://stackoverflow.com/questions/5127833/meaningful-cost-of-the-jump-instruction > On Aug 14, 2024, at 11:31 AM, Arseny Samoylov > wrote: > > Thank you for your answer! > > > We generally do

Re: [go-nuts] GOMAXPROCS?

2024-08-12 Thread robert engels
Thanks. > On Aug 12, 2024, at 1:13 PM, Ian Lance Taylor wrote: > > On Mon, Aug 12, 2024 at 6:17 AM Robert Engels wrote: >> >> Revisiting an old thread >> https://groups.google.com/g/golang-nuts/c/jPb_h3TvlKE/m/qdoHhxXeAwAJ >> >> Is it still the case

[go-nuts] GOMAXPROCS?

2024-08-12 Thread Robert Engels
Hi, Revisiting an old thread https://groups.google.com/g/golang-nuts/c/jPb_h3TvlKE/m/qdoHhxXeAwAJ Is it still the case that high disk IO throughput requires a GOMAXPROCS seething higher than the number of cpus on the system? Are there any other cases where this might be required? Thanks. --

Re: [go-nuts] Order of calls to conn.Read and conn.Write on server and client

2024-08-11 Thread Robert Engels
Also the proper use of Go routines allow you to implement async without the messiness of callbacks. On Aug 11, 2024, at 1:49 PM, Robert Engels wrote:This is not true. The synchronous requirements are based on higher level protocol requirements. You can just as easily do async with Reader and

Re: [go-nuts] Order of calls to conn.Read and conn.Write on server and client

2024-08-11 Thread Robert Engels
This is not true. The synchronous requirements are based on higher level protocol requirements. You can just as easily do async with Reader and Writer. Eg. The client can send multiple requests and the server could respond to these out of order (I.e the response contains the request id) or not resp

Re: [go-nuts] Why do I get "The connection was reset" error when uploading a ~10MB file, and how to avoid reading the file into memory?

2024-08-02 Thread Robert Engels
Check out this https://jesseduffield.com/Golang-IO-Cookbook/ to see how to transfer the body to a file without reading the whole thing into memory. On Aug 2, 2024, at 12:41 PM, Robert Engels wrote:You most likely have to read the incoming data. Depends on the framework. The tcp connection is

Re: [go-nuts] Why do I get "The connection was reset" error when uploading a ~10MB file, and how to avoid reading the file into memory?

2024-08-02 Thread Robert Engels
You most likely have to read the incoming data. Depends on the framework. The tcp connection is reused so if you don’t read all of the sent data then the next request will be corrupted. I am not sure why it works with small files - I guess that the framework is reading some of the data into the req

Re: [go-nuts] photoslibrary/v1 no longer available

2024-08-01 Thread robert engels
There is also a third-party library that might work or be a great starting point: https://github.com/gphotosuploader/google-photos-api-client-go > On Aug 1, 2024, at 9:15 AM, robert engels wrote: > > It should be fairly straightforward to use the Rest api directly

Re: [go-nuts] photoslibrary/v1 no longer available

2024-08-01 Thread robert engels
It should be fairly straightforward to use the Rest api directly https://developers.google.com/photos/library/guides/get-started You can also look at the Java or PhP client library and reimplement in Go - sadly it doesn’t seem th

Re: [go-nuts] How to refresh database/sql MySQL connection username and password

2024-07-29 Thread Robert Engels
I am fairly certain the reconnection details, etc will be driver specific.  Many dbs will not drop the current connections when changing passwords - only used when a new connection is created. The easiest solution is to set the max connection lifetime on the pool, and change the password there to m

Re: [go-nuts] Re: how to start with go?

2024-07-23 Thread Robert Engels
A few people have reached out to tell me they found github.com/robaho/go-trader worthwhile when learning. It was a project I initially created to learn Go myself. It touches on all of the major food groups except db access. On Jul 23, 2024, at 9:01 AM, Guilherme de Oliveira Amorim wrote:Well, usu

Re: [go-nuts] Mutex profiling question

2024-07-19 Thread Robert Engels
.. or a runtime/trace can show all of those details at once.RhysOn Thursday, July 18, 2024 at 1:00:15 PM UTC-7 robert engels wrote:Anyone have any idea on the high internal lock time on findRunnable?On Jul 18, 2024, at 10:36 AM, robert engels <ren...@ix.netcom.com> wrote:Looks like the nam

Re: [go-nuts] this code sometimes hangs

2024-07-18 Thread Robert Engels
But I think that Done() is for the outer which prevents the broadcast. By putting it in the defer all of the subscribers should be waiting on the condition when it occurs. Caveat- not looking at code - just remembering. On Jul 18, 2024, at 3:01 PM, Lammie Jonson wrote:>> defer goroutineRunning.Do

Re: [go-nuts] Mutex profiling question

2024-07-18 Thread &#x27;robert engels' via golang-nuts
Anyone have any idea on the high internal lock time on findRunnable?On Jul 18, 2024, at 10:36 AM, robert engels wrote:Looks like the name was changed to runtimecontentionstacksMuch better now…(pprof) treeShowing nodes accounting for 481.75ms, 100% of 481.75ms totalDropped 39 nodes (cum <= 2.4

Re: [go-nuts] Mutex profiling question

2024-07-18 Thread robert engels
ock but this seems suspect, that finding the runnable should consume so much time. Is this a side effect of the scheduler, and it is really blocked in the unlock call waiting for another routine to be runnable? > On Jul 18, 2024, at 10:14 AM, 'Robert Engels' via golang-nuts >

Re: [go-nuts] this code sometimes hangs

2024-07-18 Thread robert engels
To clarify, the inner Go routine calls Done() at the start, so the main can get to the Broadcast before the inners are waiting. Which is what Jan’s fix will fix :) (pretty sure) > On Jul 18, 2024, at 10:20 AM, robert engels wrote: > > Because the wait on the condition is in another G

Re: [go-nuts] this code sometimes hangs

2024-07-18 Thread robert engels
Because the wait on the condition is in another Go routine, so the the Broadcast occurs before all of the routines are waiting. Broadcast only wakes up currently waiting routines. > On Jul 18, 2024, at 9:01 AM, Lammie Jonson wrote: > > // I am not sure why this code sometimes deadlocks, but so

[go-nuts] Mutex profiling question

2024-07-18 Thread &#x27;Robert Engels' via golang-nuts
I found this issue, https://github.com/golang/go/issues/57071 and tried running with GODEBUG=profileruntimelocks=1 but it made no difference in the output. I am using Go 1.22.4 on OSX. Any ideas how I can determine what is causing this high contention shown below: (pprof) tree Showing nodes

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread &#x27;Robert Engels' via golang-nuts
Thanks. Make sense. > On Jul 16, 2024, at 9:00 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Tue, Jul 16, 2024 at 3:57 PM Robert Engels wrote: > >> Yes, I just added that tag and pushed it, but @latest wouldn’t pick it up >> for some reason, needed to spe

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread robert engels
de > > (that is, with GO111MODULE=off). Other build commands, such as go build and > > go test, will continue to work indefinitely for legacy GOPATH programs. > > On Tuesday, July 16, 2024 at 9:51:02 AM UTC-4 Robert Engels wrote: > Weird, even after I added the tag, using @late

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread &#x27;Robert Engels' via golang-nuts
Yes, I just added that tag and pushed it, but @latest wouldn’t pick it up for some reason, needed to specify the release exactly using @v0.3.1 > On Jul 16, 2024, at 8:55 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Tue, Jul 16, 2024 at 3:50 PM Robert Engels wrote: >> &

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread &#x27;Robert Engels' via golang-nuts
Weird, even after I added the tag, using @latest did not pull the latest code, I needed to specify the tag specifically @v0.3.1 > On Jul 16, 2024, at 8:48 AM, Robert Engels wrote: > > Thanks. Yea, because it needs a later tag now. I guess it never compiled > after I changed go-t

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread &#x27;Robert Engels' via golang-nuts
Thanks. Yea, because it needs a later tag now. I guess it never compiled after I changed go-trader to use modules. > On Jul 16, 2024, at 8:47 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Tue, Jul 16, 2024 at 3:41 PM 'Robert Engels' via golang-nuts > wrote: >

Re: [go-nuts] Importing non-module based code

2024-07-16 Thread robert engels
I think I figured it out. I need to create a tag I guess? Since @latest doesn’t pull head ? This seems to have changed, because I “think” this used to compile fine. > On Jul 16, 2024, at 8:40 AM, 'Robert Engels' via golang-nuts > wrote: > > Has it changed so that

[go-nuts] Importing non-module based code

2024-07-16 Thread &#x27;Robert Engels' via golang-nuts
Has it changed so that Go repo that imports a from another repo that doesn’t use modules no longer works? Maybe a recent change? I have a repo github.com/robaho/go-trader that imports githut.com/robaho/gocui (which is a fork

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread &#x27;Robert Engels' via golang-nuts
items but the output it still the time it takes to run the sort, not the sort time amortized per item. Making it much more difficult to compare different algorithms and different container sizes. > On Jul 8, 2024, at 3:51 PM, Jan Mercl <0xj...@gmail.com> wrote: > > On

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread &#x27;Robert Engels' via golang-nuts
onical way of doing this? > On Jul 8, 2024, at 3:22 PM, Jan Mercl <0xj...@gmail.com> wrote: > > On Mon, Jul 8, 2024 at 10:08 PM 'Robert Engels' via golang-nuts > wrote: > >> Given this code (which I know is not “correct”): > > Setting b.N in the bench

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread robert engels
Actually, if I add b.Log("time per op",float64(b.Elapsed().Microseconds())/float64(N_ORDERS*2)) I get a different value than what benchmark reports, so I am certain setting b.N is not correct. > On Jul 8, 2024, at 3:08 PM, 'Robert Engels' via golang-nuts > w

[go-nuts] Benchmark "overall" operation

2024-07-08 Thread &#x27;Robert Engels' via golang-nuts
Given this code (which I know is not “correct”): func BenchmarkOrders(b *testing.B) { var ob = orderBook{} var inst = Equity{} var ex = testExchangeClient{} const N_ORDERS = 100 b.ResetTimer() b.N = N_ORDERS for i:=0;ihttps://groups.google.com/d/msgid/golang-nut

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
I corrected myself. On Jul 6, 2024, at 10:34 AM, peterGo wrote:On Saturday, July 6, 2024 at 11:21:46 AM UTC-4 Robert Engels wrote:That is not a data race. The wait group is a synchronization barrier. ==WARNING: DATA RACEWrite at 0x00c14158 by goroutine 8:  main.main.func1

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
Sorry and the outer loop is the only reader. It probably reports it as a race though since there are multiple writers - but they all write the same value. Technically still a data race depending on if the word splits when writing. On Jul 6, 2024, at 10:20 AM, Robert Engels wrote:That is not a

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
That is not a data race. The wait group is a synchronization barrier. On Jul 6, 2024, at 9:34 AM, 'qiu laidongfeng2' via golang-nuts wrote:I know not to write code with data races?The problem is that I find that this code always outputs 1 on the amd64 machine,I am not sure what effect this data c

Re: [go-nuts] More excellent work by the Go team!

2024-06-22 Thread robert engels
avgt9 0.942 ± 0.005 ns/op TestJavaDispatch.TestIDispatch avgt9 1.341 ± 0.040 ns/op So the error is much less. > On Jun 21, 2024, at 2:14 PM, Robert Engels wrote: > > Yep. Haven’t dig into it. I assume it has to do with allocations. That it is > 2x faste

Re: [go-nuts] Re: More excellent work by the Go team!

2024-06-21 Thread Robert Engels
ty wide error bars though...On Friday 21 June 2024 at 17:15:05 UTC+1 Robert Engels wrote:I had the opportunity to revisit my interface dispatch benchmark (https://github.com/robaho/go-dispatch-test).Previously, the dispatching using pointer receivers was nearly 3x slower (i.e. 5.5 ns to 12.6 ns):goos:

[go-nuts] More excellent work by the Go team!

2024-06-21 Thread &#x27;Robert Engels' via golang-nuts
I had the opportunity to revisit my interface dispatch benchmark (https://github.com/robaho/go-dispatch-test ). Previously, the dispatching using pointer receivers was nearly 3x slower (i.e. 5.5 ns to 12.6 ns): goos: darwin goarch: amd64 pkg: github.

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Robert Engels
What I asked did not require the first, I was referring more about the latter. So regardless of how it is implemented it is always false. On Jun 20, 2024, at 7:39 AM, Axel Wagner wrote:On Thu, 20 Jun 2024 at 14:21, Robert Engels <reng...@ix.netcom.com> wrote:I would add that I think the G

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Robert Engels
I would add that I think the Go team should strive to remove as much “implementation defined” or “undefined” from the spec as possible. Forgo the optimizations. It’s this language that makes C++ such a pain to work with especially in a cross platform manner. I think you can safely narrow the spec i

Re: [go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Robert Engels
Nothing is writing and closing StdInR so it will never complete. On Jun 17, 2024, at 9:54 PM, Salvatore Domenick Desiano wrote:A bunch of typos. The last paragraph should have been:This program deadlocks after 5 seconds. The three deadlocked Go routines are the explicit go func() (stuck on io.Cop

Re: [go-nuts] Breaking an io.Pipe loop

2024-06-17 Thread Robert Engels
Code?On Jun 17, 2024, at 9:46 PM, Salvatore Domenick Desiano wrote:I've got some code that is basically Expect-lite written in Go. I've got a deadlock and I'm hoping someone here can help me untangle it. I posted this yesterday but at the time I thought the Expect part of the code wasn't relevant

Re: [go-nuts] Fwd: cmd.Wait & io.Pipe & SIGKILL

2024-06-16 Thread Robert Engels
It hangs because cmd.Run() waits for the process to complete - and with nothing reading the pipe it will never complete. On Jun 16, 2024, at 9:33 PM, Robert Engels wrote:It looks like you don’t have anything reading from the pipe so it’s going to hang. On Jun 16, 2024, at 8:54 PM, Salvatore

Re: [go-nuts] Fwd: cmd.Wait & io.Pipe & SIGKILL

2024-06-16 Thread Robert Engels
It looks like you don’t have anything reading from the pipe so it’s going to hang. On Jun 16, 2024, at 8:54 PM, Salvatore Domenick Desiano wrote:Simpler self-contained example, same result:func main() { cmdName := "/bin/bash" cmdArgs := []string{"-c", "while true; do echo step; sleep 1; done"}cmd

Re: [go-nuts] Re: coroutine size

2024-06-15 Thread Robert Engels
I don’t think that is possible. You can have stackless coroutines, but if a coroutine has no state at all it would simply be implements as a method call chain without parameters in an executor. I doubt these are very useful. On Jun 15, 2024, at 10:08 PM, cheng dong wrote:ahh, i really want to say

Re: [go-nuts] strip / reduce module compile size

2024-06-14 Thread robert engels
Something doesn’t seem right... You state the total compiled size is 22MB, but the first 3 entries combined are more than that. > On Jun 14, 2024, at 4:43 PM, Tony M wrote: > > Thank you to github.com/jondot/goweight I was able to determine the compiled > module sizes (below). Heavy hitters ar

Re: [go-nuts] Does I/O in Goroutine blocks the underlying thread?

2024-05-31 Thread robert engels
It does. I think the wording is wrong - the Go routine blocks - but the carrier thread (that was running the Go routine) runs another Go routine (if needed and ready to run). > On May 31, 2024, at 2:54 AM, Haoyang Fan wrote: > > Hi everyone, > > I was always under the impression that Go solel

Re: [go-nuts] Memory operations hung in semacquire state, GC routine parked while holding semaphore?

2024-05-29 Thread robert engels
olang? I don't > have much windows experience, so my assumption would be that the Windows > equivalent of the OOMKiller would kick in and just kill the application. > > On Tuesday, May 28, 2024 at 4:04:15 PM UTC-7 robert engels wrote: > Feels like a memory leak to me. I would look

Re: [go-nuts] Memory operations hung in semacquire state, GC routine parked while holding semaphore?

2024-05-28 Thread robert engels
Feels like a memory leak to me. I would look for growing heap size in the gc logs. I am guessing that the system is not completely hung - but rather the runtime is having a hard time obtaining more memory, so it is slowing the allocators to a rate that makes them appear hung. It may be that the

Re: [go-nuts] Errors trying to use external pkg z3

2024-05-22 Thread robert engels
If it is your own code, you have to use import “github.com/aclements/go-z3/z3 <http://github.com/aclements/go-z3/z3>” or you need a special go.mod file. > On May 22, 2024, at 9:38 AM, robert engels wrote: > > What are you trying to run? z3 is a library. > >> On

Re: [go-nuts] Errors trying to use external pkg z3

2024-05-22 Thread robert engels
What are you trying to run? z3 is a library. > On May 22, 2024, at 9:29 AM, Kenneth Miller > wrote: > > I did go get -u github.com/aclements/go-z3/z3 > > but when I go run . I get > > main.go:5:2: package z3 is not in std > > the offending line is > > import "z3" > > can someone help me p

Re: [go-nuts] Bitmask is slower than modulo calculation

2024-05-12 Thread robert engels
> } > > func BenchmarkTestSingleModulo(b *testing.B) { > rb := NewRingBuffer0(BufferSize) > b.ResetTimer() > benchmarkSingle(rb) > } > > func BenchmarkTestSingleBitMask(b *testing.B) { > rb := NewRingBuffer1(BufferSize) > b.ResetTimer() &g

Re: [go-nuts] Bitmask is slower than modulo calculation

2024-05-12 Thread robert engels
Use the Go benchmarking facilities, see https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go > On May 11, 2024, at 9:57 PM, leon wrote: > > I'm trying to prove an optimization technique for ring buffer is effective. > One of the technique is using bitmask instead of modulo to calcu

Re: [go-nuts] Congrats to the Go team

2024-04-27 Thread Robert Engels
somehow optimising the function call away.On Sat, 27 Apr 2024 at 05:12, robert engels <reng...@ix.netcom.com> wrote:Apologies. The assembly files were reversed. But the timings remain the same.I will get the assembly of the test compiles tomorrow  - but if these differ - that suggests that th

Re: [go-nuts] Congrats to the Go team

2024-04-26 Thread Robert Engels
uce.Also, the assembly of Fixed.Add isn't the thing I'm curious about. It is the assembly of BenchmarkAddFixed. Fixed.Add will probably be inlined into that function, and possibly optimized away.On Friday, April 26, 2024 at 5:44:01 AM UTC-7 robert engels wrote:There seems to be a material d

Re: [go-nuts] Congrats to the Go team

2024-04-26 Thread Robert Engels
know for sure without looking at the generated code for BenchmarkAddFixed.On Thursday, April 25, 2024 at 10:54:42 AM UTC-7 Robert Engels wrote:There is a pretty significant degradation in AddFixed() which may be concerning to the Go team, because the code of AddFixed is simply:// Add adds f0 to f prod

Re: [go-nuts] Congrats to the Go team

2024-04-25 Thread &#x27;Robert Engels' via golang-nuts
t alpha level 0.05. > > Basically run the benchmark with a -count=6 or more and then run the tool, > and you get a the comparison values which are typically the interesting bit > > On Thu, 25 Apr 2024 at 00:29, Robert Engels <mailto:rob...@me.com>> wrote: >

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread robert engels
0.000 ± ∞ ¹ 0.000 ± ∞ ¹~ (p=1.000 n=1) ² geomean⁴-12.73% ⁴ > On Apr 24, 2024, at 6:29 PM, 'Robert Engels' via golang-nuts > wrote: > > │ /Users/robertengels/go

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread &#x27;Robert Engels' via golang-nuts
g.go.dev/golang.org/x/perf/cmd/benchstat > <https://pkg.go.dev/golang.org/x/perf/cmd/benchstat> which will provide a > nice side by side comparison? > > On Wed, 24 Apr 2024 at 19:26, 'Robert Engels' via golang-nuts > mailto:golang-nuts@googlegroups.com>> wrote

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread robert engels
, so I'd be interested in > hearing how you think it performs with 1.22.0 > On Wednesday 24 April 2024 at 19:27:07 UTC+1 Robert Engels wrote: > I have a fairly stable project github.com/robaho/fixed > <http://github.com/robaho/fixed> which is almost 100% cpu bound. It doesn’t

[go-nuts] Congrats to the Go team

2024-04-24 Thread &#x27;Robert Engels' via golang-nuts
I have a fairly stable project github.com/robaho/fixed which is almost 100% cpu bound. It doesn’t change so it makes a great way to compare the performance of different Go versions using the same hardware. I took the time to re-run the tests today. Using 1.21.17

Re: [go-nuts] Critical Section - static analysis

2024-04-24 Thread robert engels
The github link you provided results in a 404 error. > On Apr 22, 2024, at 1:58 PM, Stephen Illingworth > wrote: > > Hello, > > I've created a proof-of-concept for a method of defining critical sections. > Crucially, the scheme allows for static analysis, thereby helping prevent > violations o

Re: [go-nuts] xml to json, parsing xml

2024-04-23 Thread robert engels
I don’t think that is true. There are multiple ways to model XML into json. See this http://badgerfish.ning.com for one of them. > On Apr 23, 2024, at 11:43 AM, burak serdar wrote: > > In general, you cannot convert xml to json. They have incompatible > models. XM

Re: [go-nuts] Re: Concurrent queries in a single transaction

2024-04-19 Thread Robert Engels
As you state, the driver (and db) need to support this. The synchronization for something like this is internal. But, if the operations are modifying the same tables you may end up with serialized operations anyway in order to ensure consistency while avoiding deadlocks. On Apr 20, 2024, at 12:11 A

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-03 Thread Robert Engels
esn't work.Thank-you!JimOn Wed, 3 Apr 2024 at 12:46, Robert Engels <reng...@ix.netcom.com> wrote:Just create a recyclable transport for the bad server and put all of the rest on a single shared transport. If one connection is returning 500 for all requests I can’t see how a different

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-03 Thread Robert Engels
conns and gobbles up a disproportionate share of requests.Tangential question, when the backend servers land in this state does the lb not detect and remove them? -eli On Apr 3, 2024, at 6:41 AM, Robert Engels wrote:That probably wasn’t clear. Why not create a Transport per host. Then when the 500

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-03 Thread Robert Engels
That probably wasn’t clear. Why not create a Transport per host. Then when the 500 is encountered stop using that transport completely and create a new instance. Probably want to cancel any requests currently in flight. The connection pool is per transport. On Apr 2, 2024, at 11:05 PM, Eli Lindsey

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-02 Thread Robert Engels
My guess is that if you are getting a 500 you have exhausted the server or capacity. So close the client completely and perform an exponential back off. You can wrap all of this at a higher level to keep the synchronous behavior. On Apr 2, 2024, at 7:37 PM, Jim Minter wrote:That's possible, but t

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-10 Thread Robert Engels
Apologies.On Mar 9, 2024, at 1:16 PM, Ian Lance Taylor wrote:This thread has gotten heated.  I think it's time to move on to different topics and give this discussion a rest.  Thanks.Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsub

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
at 9:58:26 PM UTC-5 Robert Engels wrote:Related, 30k of anything is largely meaningless for modern hardware in terms of cpu processing - where billions of operations a second is the norm. On Mar 8, 2024, at 8:55 PM, Robert Engels <ren...@ix.netcom.com> wrote:The point I was trying to make -

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
Related, 30k of anything is largely meaningless for modern hardware in terms of cpu processing - where billions of operations a second is the norm. On Mar 8, 2024, at 8:55 PM, Robert Engels wrote:The point I was trying to make - maybe unclear - is that it is doubtful any raw performance

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
refer to know rather than wrongly assume.-MikeOn Friday, March 8, 2024 at 8:28:38 PM UTC-5 Robert Engels wrote:Just to be clear for others - from a raw cpu performance perspective when looking at a typical application in whole - there is very little performance difference between compiled a

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
-json-per-second-in-go/And benchmarks from someone who is not an author of one of those packages:https://kokizzu.blogspot.com/2022/12/map-to-struct-and-struct-to-map-golang.html Hope this helps.-MikeOn Friday, March 8, 2024 at 4:15:25 PM UTC-5 Robert Engels wrote:It is highly unlikely that t

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
It is highly unlikely that the Go marshaling is the cause. I’m guessing you are probably not using a buffered output stream. PHP is written in C but depending on what you are doing it is either a script or calling out to another process (afaik) On Mar 8, 2024, at 2:35 PM, pragya singh wrote:Hi,"I

Re: [go-nuts] Plea for help diagnosing strange "signal: killed" issues in previously-working code

2024-03-02 Thread Robert Engels
file served out by my go app to prevent this, and perhaps consider other client session ids to prevent outside crawlers from accidentally activating my app's link endpoints.Thank you again, all.On Sat, Mar 2, 2024 at 6:23 PM Robert Engels <reng...@ix.netcom.com> wrote:I would  be also try

Re: [go-nuts] Plea for help diagnosing strange "signal: killed" issues in previously-working code

2024-03-02 Thread Robert Engels
the system is just fine, I just cannot seem to run these scripts any more when launched from my go program (again, even a 'do-nothing' script that just sleeps a few times, then completes with exit status 0, no longer works -- it just gets 'killed').On Sat, Mar 2, 2024 at 7:39 PM Rob

Re: [go-nuts] Plea for help diagnosing strange "signal: killed" issues in previously-working code

2024-03-02 Thread Robert Engels
Please clarify - does it work using the older versions of Go?On Mar 2, 2024, at 12:53 PM, Russtopia wrote:I have tried rebuilding with go1.18.6, go1.15.15 with no difference.On Sat, Mar 2, 2024 at 6:23 PM Robert Engels <reng...@ix.netcom.com> wrote:I would  be also try reverting the Go v

Re: [go-nuts] Plea for help diagnosing strange "signal: killed" issues in previously-working code

2024-03-02 Thread Robert Engels
I would be also try reverting the Go version and ensure that it continues to work. Other system libraries may have been updated. > On Mar 2, 2024, at 12:05 PM, Ian Lance Taylor wrote: > > On Sat, Mar 2, 2024 at 9:59 AM Russtopia wrote: >> >> Symptom: mysterious "signal: killed" occurrences

Re: [go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-01 Thread Robert Engels
The could be calling fork() as in the system call - which copies all file descriptors but I didn’t think Go processes could fork. Seems you would need to remap stdin and stdout in the fork to do anything useful. This sounds very PHP - what goes around comes around. > On Mar 1, 2024, at 8:01 

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-21 Thread Robert Engels
That is a good reason as to why putting timeouts and cancellation in the “context” always felt wrong to me. These are per request notions - and creating a new context to specify them seems off. But as I mentioned in the other post, without a concept of security context it doesn’t matter much - just

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Robert Engels
FWIW, I think having a bound context to an execution context is a valuable addition. One thing about Go that has always felt lacking is dynamic code loading execution. There is the plugin facility but it doesn’t seem to have been widely adopted. If it were, I think the Go team would find it needs a

Re: [go-nuts] Re: KeepAlive with net.Listen

2024-02-11 Thread Robert Engels
ebruary 11, 2024 at 5:00:02 PM UTC-8 Robert Engels wrote:If it is a web server that supports http clients you still have to implement the protocol correctly. At the lowest level that is what all web server implementations do - they read from the socket directly. On Feb 11, 2024, at 7:54 PM,

Re: [go-nuts] Re: KeepAlive with net.Listen

2024-02-11 Thread Robert Engels
ed earlier, objective is to create a web server without using net/http, instead directly reading from the socket connection.On Sunday, February 11, 2024 at 4:49:09 PM UTC-8 Robert Engels wrote:If you have http keep alive on - either side should block when reading - it is a full duplex connection

Re: [go-nuts] Re: KeepAlive with net.Listen

2024-02-11 Thread Robert Engels
y, February 11, 2024 at 2:30:44 PM UTC-8 Robert Engels wrote:There is no such thing as a pool of idle connections at the tcp level. As each side of the connection is bound to a specific port on both ends and can’t be unbound. You may be referring to http over tcp where the client and server do not

Re: [go-nuts] Re: KeepAlive with net.Listen

2024-02-11 Thread Robert Engels
There is no such thing as a pool of idle connections at the tcp level. As each side of the connection is bound to a specific port on both ends and can’t be unbound. You may be referring to http over tcp where the client and server do not close the connection after each request - they keep it open f

Re: [go-nuts] help with thread limit

2024-01-31 Thread Robert Engels
You can use cpuctrl or similar to limit the number of visible cores when you start the process. On Jan 31, 2024, at 8:43 PM, Steve Roth wrote:I am running Go code on a shared web hosting server from a major hosting company.  Using cgroups, they limit the number of threads any user can create to 2

Re: [go-nuts] Re: Good examples of Go back ends?

2024-01-22 Thread Robert Engels
github.com/robaho/go-trader has many easy to follow examples - authentication, multicast , routing, rest apis, websockets. A major system not covered though is db access. On Jan 22, 2024, at 9:23 AM, george looshch wrote:hi Jason,thanks a million for pointing out the vagueness of my question! Eng

Re: [go-nuts] Re: does anyone have an example of a Go kernel module

2024-01-07 Thread Robert Engels
Hasn’t been touched in 6 years and it doesn’t work. I guess they figured out it wasn’t worth the effort. The only plausible way to write a kernel module in Go is… don’t.Maybe run a user space Go process and some sort of shared memory communication. On Jan 7, 2024, at 8:06 PM, Hữu Hà wrote:Maybe y

Re: [go-nuts] How to convert a net.Addr into a netip.AddrPort ?

2023-12-24 Thread Robert Engels
github.com/robaho/go-trader has udp multicast support with both server and client codeOn Dec 24, 2023, at 11:05 AM, christoph...@gmail.com wrote:Hello,I'm developping a UDP client server program. Everything is clear on the server side. I'm just a bit confused with the client side. In C we can spe

  1   2   3   4   5   6   7   8   9   10   >