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

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

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

2024-04-27 Thread Robert Engels
is 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
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 difference in the generated code.The

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

2024-04-26 Thread Robert Engels
ure 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 producing a Fi

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

2024-04-25 Thread '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/go1.21.5.txt

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

2024-04-24 Thread '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: > I h

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

2024-04-24 Thread robert engels
e 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 > change

[go-nuts] Congrats to the Go team

2024-04-24 Thread '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

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

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.

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 

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

2024-04-03 Thread Robert Engels
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 connection

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

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

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

2024-03-08 Thread Robert Engels
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 - maybe u

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
now 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 and even GC

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

2024-03-08 Thread Robert Engels
-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 the Go

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

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

2024-03-02 Thread Robert Engels
event 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 reverting the Go version and ensure tha

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

2024-03-02 Thread Robert Engels
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 Robert Engels <reng...@ix.netcom.com> wrote:Please clarify - does i

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"

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 -

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

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

2024-02-11 Thread Robert Engels
, 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, 'Rohit Roy

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

2024-02-11 Thread Robert Engels
, 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. You

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

2024-02-11 Thread Robert Engels
y 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 close the

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

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

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!

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

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

Re: [go-nuts] Mutex contention in sql.Close()

2023-12-13 Thread robert engels
It is contending with sql.rows.awaitDone(). My guess is that when you close rows it has to wait for db acknowledgement - that this is a false positive based on wall time and not cpu time - that the mutex is waiting for the cleanup operation to complete. > On Dec 13, 2023, at 1:25 PM, Joshua

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Robert Engels
, 2023 at 6:30:11 PM UTC Robert Engels wrote:Not sure how you are detecting that the append it not working - I noticed that the binary log was not growing, and its update timestamp was not changing. I have an alias, lh, that is alias lh='ls -alFtrh|tail'that I run regularly in the course of work

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Robert Engels
Not sure how you are detecting that the append it not working - it usually does because a client can relink the inode to another file name using a syscall I think what you want to do it either 1. Open the file exclusively so git cannot do this. 2. Check that the file create time is the same

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-15 Thread Robert Engels
saying - just use pointer receivers - woefully underestimates the work to do shared concurrent code correctly. > On Nov 15, 2023, at 10:33 AM, Marvin Renich wrote: > > * Robert Engels [231114 21:55]: >> Switching to pointer receivers everywhere actually makes this worse.

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-14 Thread Robert Engels
assertion — if you fix it to work correctly by using RPC.version(*rpc)— but that is actually a different concern than I and I think Robert Engels were discussing.  Your example above calls a method directly on the struct, we were discussing calling via an interface. Given that Go already performs some

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-13 Thread Robert Engels
Lastly, the only reason that changing to a pointer receiver “solves” the race is because the field in the object isn’t accessed - something the compiler could detect in the other version as well. > On Nov 13, 2023, at 10:50 PM, Robert Engels wrote: > > Similarly, even in a single

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-13 Thread Robert Engels
Similarly, even in a single threaded Java program objects are copied/moved behind the scenes - these don’t generate race conditions as the runtime ensures there isn’t one. > On Nov 13, 2023, at 10:47 PM, Robert Engels wrote: > > To me this is a limitation of the compiler. If

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-13 Thread Robert Engels
To me this is a limitation of the compiler. If a passed argument is unused it doesn’t even need to be created. Similarly if only a few fields are used in a called function a sparse data object can be sent. It only becomes a race if the data being copied is actually used - then the race is also

Re: [go-nuts] Writing bitmap data to a canvas with WebAssembly

2023-11-07 Thread robert engels
Your numbers do not make sense. At 300 us a frame, it would be more than 3k frames a second - which would only be possible for an extremely tiny area. You need to include the time to produce the data when considering “render time” - otherwise you are talking apples and oranges. > On Nov 7,

Re: [go-nuts] Re: Recommended way to distribute pre-compiled C-dependencies for modules using CGO ?

2023-11-03 Thread Robert Engels
Better to rewrite the native portions in Go. If you’re not going to do that, just give instructions on how to build and let the app builder figure out how to package it. > On Nov 3, 2023, at 1:47 PM, Jason E. Aten wrote: > >  > It is still rough around lots of edges, but you are wanting to

Re: [go-nuts] Re: database/sql: Latency when calling DB.QueryContext()

2023-11-03 Thread Robert Engels
The internet. The gift that keeps on giving. > On Nov 3, 2023, at 7:54 AM, Al Corona wrote: > > Off topic question. But does anyone know how I can gain admin access on my > work computer? > >> On Thursday, June 29, 2017 at 12:01:16 AM UTC-7 Kai Zhang wrote: >> Go version 1.8.3 >> >> In

Re: [go-nuts] Suggestions on optimizing Go GC

2023-10-31 Thread Robert Engels
that others have mentioned. You may have an an allocation pattern that needs a generational collector which Go doesn’t offer. > On Oct 31, 2023, at 12:47 AM, Zhihui Jiang wrote: > >  > > On Monday, October 30, 2023 at 10:12:08 PM UTC-7 Robert Engels wrote: > What is the

Re: [go-nuts] Suggestions on optimizing Go GC

2023-10-30 Thread Robert Engels
What is the average wall time of a request? Based on what you wrote it appears that handling a single request generates a lot of garbage - high allocation rate - and for this to be significant I suspect the runtime is also significant - which implies to me a spawn and destroy request handler

Re: [go-nuts] Suggestions on optimizing Go GC

2023-10-29 Thread Robert Engels
If the objects are created and discarded you might be able to spawn a new process to handle the request - or maybe a bunch - then just kill it and start a new process. Possibly use shared memory for constant data. This is the poor man’s generational garbage collector. > On Oct 29, 2023, at

Re: [go-nuts] Re: Is it expected that signal.NotifyContext() changes the execution thread?

2023-10-03 Thread Robert Engels
Almost all graphics systems are single threaded. Some allow additional non rendering event loops but with heavy restrictions that GUI components are only accessed on the main event loop thread. > On Oct 3, 2023, at 2:00 AM, 'wagner riffel' via golang-nuts > wrote: > > On Tue Oct 3, 2023 at

Re: [go-nuts] Re: Help with WASM performance

2023-09-22 Thread Robert Engels
Typically WASM performance is compared to JavaScript - ie. faster than JavaScript usually 1.5-10x. People don’t usually compare WASM with native apps. > On Sep 22, 2023, at 7:04 PM, Robert Engels wrote: > >  > WASM goes through the browser - so it is very different. Are you

Re: [go-nuts] Re: Help with WASM performance

2023-09-22 Thread Robert Engels
ept for the change of architecture. > The size of the difference in performance is unexpected to me but maybe it's > normal. > >> On Friday, 22 September 2023 at 20:16:20 UTC+1 Robert Engels wrote: >> When you say negative performance are you talking about a native app running &

Re: [go-nuts] Re: Help with WASM performance

2023-09-22 Thread Robert Engels
When you say negative performance are you talking about a native app running directly on the hardware what are you referring to exactly > On Sep 22, 2023, at 1:03 PM, Stephen Illingworth > wrote: > >  > I've been thinking some more about this problem this week. I found the > performance

Re: [go-nuts] x/mobile: avoid to catch sigabort signal

2023-09-10 Thread Robert Engels
This most likely means your other code is corrupting the go runtime/heap/stack. I would run other tests on this code exclusively (asan, etc). > On Sep 10, 2023, at 12:54 PM, Danilo bestbug > wrote: > >  > Hey TheDiveO, thanks for answering. > My focus is not to hide the signal but I would

Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Robert Engels
Sorry that was snotty. Bring back the punch cards to really prove who’s a great developer! > On Aug 26, 2023, at 4:29 PM, Robert Engels wrote: > >  > Or you click on the top stack line in an IDE and then arose down. > > It’s like some people want to go back to horse

Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Robert Engels
Or you click on the top stack line in an IDE and then arose down. It’s like some people want to go back to horse and buggy “because it was better for the environment”. Balancing competing priorities is a great skill to have. > On Aug 26, 2023, at 3:51 PM, Justin Israel wrote: > >  > > >>

Re: [go-nuts] Best IDE for GO ?

2023-08-23 Thread Robert Engels
and thermodynamics at all. > >> On Sunday, August 20, 2023 at 1:57:22 PM UTC+2 Robert Engels wrote: >> MIT = “that education place” is pretty funny. But you’re spot on. >> >>>> On Aug 20, 2023, at 2:51 AM, TheDiveO wrote: >>>> >>> That education pla

Re: [go-nuts] Best IDE for GO ?

2023-08-20 Thread Robert Engels
veO wrote: > > well, our "(major) engineering orgs" leave the choice of IDE to our devs. > Devs have different styles, so as long as they meed the demand, who cares. > >> On Saturday, August 19, 2023 at 11:17:35 PM UTC+2 Robert Engels wrote: >> Reread wha

Re: [go-nuts] Best IDE for GO ?

2023-08-20 Thread Robert Engels
t;> The kinds of skills and knowledge covered by https://missing.csail.mit.edu >> are important and hard to gain from an IDE. I think that's the badge of >> competence earned here. >> >> On Saturday, August 19, 2023 at 11:21:44 AM UTC-7 Robert Engels wrote: >> The power

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Robert Engels
Reread what I wrote. Vim with autocomplete, etc is not a simple text editor with syntax coloring. Still every major software engineering org in the world uses an ide (or multiple). I guess they don’t know what they are doing. Btw, Googles current IDE is based on VSCode. > On Aug 19, 2023,

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Robert Engels
19, 2023, at 1:54 PM, Andrew Harris wrote: > > The kinds of skills and knowledge covered by https://missing.csail.mit.edu > are important and hard to gain from an IDE. I think that's the badge of > competence earned here. > > On Saturday, August 19, 2023 at 11:21:44 AM UTC-

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Robert Engels
The power of IDEs is the ease of refactoring and integration with other build tools (git, lint, github/gerrit). If you’d added all of these plugins to vim - you’ve created your own ide - and it probably pales in comparison to a real IDE.Using plain vim as a badge of competence was disproven long

Re: [go-nuts] Best IDE for GO ?

2023-08-19 Thread Robert Engels
I would just have chatgpt write all your Go code. > On Aug 19, 2023, at 7:41 AM, peterGo wrote: > >  > On Saturday, August 19, 2023 at 6:23:39 AM UTC-4 TheDiveO wrote: > Nothing better than an IBM card puncher as my IDE! > > I prefer a Teletype Model 33 ASR. > > -- > You received this

Re: [go-nuts] Error handling

2023-07-31 Thread robert engels
For some perspective. Go’s error handling mimics C (for the most part). They had a decade to decide how to improve the error handling when they designed C++. They came up with exceptions. Java is C++ like. They had a decade to improve error handling. They came up with exceptions + throws. The

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-24 Thread Robert Engels
I’m fairly certain Reddit will license those tools for moderators use. That is not what they are trying to prevent. > On Jun 24, 2023, at 8:39 AM, Wojciech S. Czarnecki wrote: > > Dnia 2023-06-23, o godz. 23:50:32 > Amnon napisał(a): > >> Sorry, but I have been away and missed the context.

Re: [go-nuts] Locking (`__GI___pthread_mutex_unlock`) takes most of the execution time when using cgo with large number of CPUs

2023-06-20 Thread robert engels
Since this is an initialization guard - can’t it simply be double checked with an atomic flag? > On Jun 20, 2023, at 9:04 AM, Ian Lance Taylor wrote: > > On Tue, Jun 20, 2023 at 5:32 AM Bảo Phan Quốc wrote: >> >> I'm using cgo to call a C function from Go. Inside the C function there is a

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Robert Engels
instance for IDEs; also > I'm often coding in a Jupyter Notebook using GoNB, which would also need > modifications. Better if there was some form of support for the language. I'm > hoping some error handling proposal would cover this use case. > > > On Sun, Jun 18,

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Robert Engels
Seems the easiest way to address that is with a DSL and a code generator. > On Jun 18, 2023, at 9:47 AM, Jan Pfeifer wrote: > >  > hi Shulhan, I see your points, thanks for the reply. Let me comment on them > below: > >> On Sat, Jun 17, 2023 at 9:21 AM Shulhan wrote: >> Hi Jan, thanks for

Re: [go-nuts] is running interactive or not

2023-06-10 Thread Robert Engels
No need to even think about this. Look at ssh and mimic their practices. It has been thoroughly audited. > On Jun 10, 2023, at 5:35 AM, quin...@gmail.com wrote: > > there has been much discussion in the past about programs that modify their > behaviour depending on what stdout is; >

Re: [go-nuts] Can we further optimize the scheduling order of goroutines in sync.Mutex?

2023-06-05 Thread Robert Engels
That is implicit since the list of waiters is ordered. > On Jun 5, 2023, at 7:08 AM, fliter wrote: > > Thanks for your answer. But I wonder if the elements behind the queue may > wait for a very long time? Can we maintain a waiting time after entering the > queue for each coroutine, and

Re: [go-nuts] Re: Lots of retained free spans

2023-05-29 Thread Robert Engels
Go GC does not use a compacting/copying collector so depending on your allocation patterns you could see this behavior. But you’re stating > 70% free spade available. I.e It may be that these are holes that cannot be released to the OS. > On May 29, 2023, at 10:08 AM, Gleb Petrovichev >

Re: [go-nuts] Re: HTTP client timeout

2023-05-05 Thread Robert Engels
I mean you can use curl to simulate the 1000’s of clients (depending on protocol dependencies) > On May 5, 2023, at 9:23 AM, envee wrote: > > Hi Robert, Yes I have tried HTTP request via curl. That yields a response in > about 200ms. > >> On Friday, 5 May 2023 at 2

Re: [go-nuts] Re: HTTP client timeout

2023-05-05 Thread Robert Engels
Have you tried using curl as the client in order to narrow down the problem? > On May 5, 2023, at 7:45 AM, envee wrote: > > An update. > The VM on which I am running has 40 vCPUs. > I changed my GOMAXPROCS to a lower value of 8. > And also changed my client to use 90 HTTP/2 connections

Re: [go-nuts] Re: Short Variable Declarations Are Oversold

2023-04-24 Thread Robert Engels
If you use Go’s “accept interfaces return concrete types” the dev/ide knows to declare the concrete type. Type inference can actually cause more issues during refactorings - not alleviate them. Personally, I find types make the code easier to read. But when I write ago I don’t use them. I

Re: [go-nuts] Short Variable Declarations Are Oversold

2023-04-23 Thread Robert Engels
ner > wrote: >  > > > On Sun, Apr 23, 2023 at 4:01 PM Robert Engels wrote: >> Personally that syntax has always bothered me with readability. It requires >> lots of previous knowledge in some cases. A syntax like >> >> x, var y int = blah >

Re: [go-nuts] Short Variable Declarations Are Oversold

2023-04-23 Thread Robert Engels
To clarify, the semantics of a go statement from a language perspective changes based on earlier statements. That is simply weird - and hurts readability. > On Apr 23, 2023, at 9:01 AM, Robert Engels wrote: > >  > Personally that syntax has always bothered me with readability.

Re: [go-nuts] Short Variable Declarations Are Oversold

2023-04-23 Thread Robert Engels
Personally that syntax has always bothered me with readability. It requires lots of previous knowledge in some cases. A syntax like x, var y int = blah Is more explicit that x is reused and y is declared. Go is all about being explicit until it isn’t. > On Apr 23, 2023, at 8:28 AM, 'Axel

Re: [go-nuts] Improving IPC latency?

2023-04-09 Thread Robert Engels
Linux context switch is 6-7 usec. Usually it is more cache invalidation that causes the whole code to run slow. Usually spinning is the only solution and core/cpu isolation. > On Apr 9, 2023, at 1:33 PM, TH wrote: > > Hey, > > I'm building a software which handles hundred-ish concurrent

Re: [go-nuts] Need help: Calling panic() is corrupting system stack

2023-04-04 Thread robert engels
t_cgo_panichttps://github.com/MariappanBalraj/test_cgo_panic.githttps://github.com/MariappanBalraj/test_cgo_panic/archive/refs/heads/main.zipBest RegardsMariappanOn Mon, Apr 3, 2023 at 9:50 AM Robert Engels <reng...@ix.netcom.com> wrote:I would start by publishing a small reproducible test case on gith

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Robert Engels
Interesting - that page has “ Thread stacks are allocated in shared memory, making it valid to pass pointers to stack variables between threads and procs.” That seems very difficult to pull off safely. > On Apr 3, 2023, at 9:46 PM, Skip Tavakkolian > wrote: > > On Mon, Apr 3, 2023 at 5:22 

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Robert Engels
:28 PM, Nigel Tao wrote: > On Tue, Apr 4, 2023 at 11:22 AM Robert Engels wrote: >> the processing often involves subsequent stages operating on a subset of the >> original channels based on the earlier. > > I get that, in theory. Rob's pause channel is a simple example of

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Robert Engels
PM, Nigel Tao wrote: > > On Tue, Apr 4, 2023 at 10:13 AM Robert Engels wrote: >> I think it is as simple as looking at kselect/poll in posix. Each descriptor >> can be viewed as an independent channel of info/objects. >> >> Select with Go channels works sim

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Robert Engels
I think it is as simple as looking at kselect/poll in posix. Each descriptor can be viewed as an independent channel of info/objects. Select with Go channels works similarly and has similar usefulness. > On Apr 3, 2023, at 7:00 PM, Nigel Tao wrote: > > On Mon, Apr 3, 2023 at 8:14 PM Rob

Re: [go-nuts] Need help: Calling panic() is corrupting system stack

2023-04-02 Thread Robert Engels
I would start by publishing a small reproducible test case on github that fully compiles that demonstrates the issue. > On Apr 2, 2023, at 10:59 PM, mariappan balraj > wrote: > >  > Hello Go Experts, > > It is good if someone can help on this? > > Best Regards > Mariappan >> On Sat, Apr

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread robert engels
Am arbitrary byte can be encoded in 2 HEX characters - only a 2x increase in size not 8x. > On Mar 13, 2023, at 2:35 PM, Volker Dobler wrote: > > On Monday, 13 March 2023 at 17:41:42 UTC+1 Van Fury wrote: > Relating to my previous question, I have been reading but it is still not > clear to

Re: [go-nuts] Detecting / Avoiding network bottleneck when sending concurrent HTTP requests to many hosts.

2023-03-06 Thread Robert Engels
Have you used netstat to check how many open connections you have? You probably need to forcibly close them so they don’t end up in time wait states. Also, you don’t say what N is? Lastly you will get different errors for a dns or host error than a resources exhausted. If you configure the

Re: [go-nuts] go --> wasm: syscall.Mmap

2023-02-17 Thread Robert Engels
See https://github.com/WebAssembly/WASI/issues/304 > On Feb 17, 2023, at 2:44 PM, Robert Engels wrote: > > You must like need to use WASI - but it doesn’t support mmap :( > >>> On Feb 17, 2023, at 2:37 PM, Ian Lance Taylor wrote: >>> >>> On Fri, Feb 1

Re: [go-nuts] go --> wasm: syscall.Mmap

2023-02-17 Thread Robert Engels
You must like need to use WASI - but it doesn’t support mmap :( > On Feb 17, 2023, at 2:37 PM, Ian Lance Taylor wrote: > > On Fri, Feb 17, 2023 at 9:11 AM Stan Srednyak wrote: >> >> thanks for your reply. >> The Mmap functionality is crucial for my app. I am dealing with large binary >>

Re: [go-nuts] Re: Upgradable RLock

2023-02-13 Thread Robert Engels
ConcurrentHashMap works that way in Java. Multiple write locks on portions of the table and CAS/atomic reading. > On Feb 13, 2023, at 1:45 PM, 'drc...@google.com' via golang-nuts > wrote: > > Could you use an applicative data structure? (e.g., a balanced binary tree > where you allocate a

[go-nuts] Re: Re-entrant locks?

2023-02-07 Thread Robert Engels
And you have to make sure that a ctx is not incorrectly shared… ugh. > On Feb 7, 2023, at 7:41 AM, Robert Engels wrote: > > I know this topic comes up a bit and I’ve done a bit more research. > > Is a contributing reason that Go does not have re-entrant locks is that Go >

[go-nuts] Re-entrant locks?

2023-02-07 Thread Robert Engels
I know this topic comes up a bit and I’ve done a bit more research. Is a contributing reason that Go does not have re-entrant locks is that Go does not have any way to get Go routine identity? It seems you cannot write a reentrant lock - at least not with the typical syntax - without

Re: [go-nuts] Upgradable RLock

2023-02-04 Thread robert engels
t;> wrote: > > On Sat, Feb 4, 2023 at 3:24 PM Robert Engels <mailto:reng...@ix.netcom.com>> wrote: >> >> That only works if what it is pointing to is cheap to copy. If it is a large >> multi-layer structure a RW lock is usually more efficient. > > No sign

Re: [go-nuts] Upgradable RLock

2023-02-04 Thread Robert Engels
That only works if what it is pointing to is cheap to copy. If it is a large multi-layer structure a RW lock is usually more efficient. > On Feb 4, 2023, at 5:19 PM, Ian Lance Taylor wrote: > > On Sat, Feb 4, 2023 at 3:11 PM Robert Engels wrote: >> >> I think

Re: [go-nuts] Upgradable RLock

2023-02-04 Thread Robert Engels
3 at 8:49 AM robert engels wrote: >> >> I took some time to put this to a test. The Go program here >> https://go.dev/play/p/378Zn_ZQNaz uses a VERY short holding of the lock - >> but a large % of runtime holding the lock. >> >> (You can’t run it on the Playg

Re: [go-nuts] Upgradable RLock

2023-02-04 Thread Robert Engels
member reading their patent and > looking at the kernel implementation and thinking to myself how brilliant the > concept was. > >> On Sat, Feb 4, 2023 at 8:49 AM robert engels wrote: >> I took some time to put this to a test. The Go program here >> https://go.dev/pl

  1   2   3   4   5   6   7   8   9   10   >