[go-nuts] Re: C++ 11 to Golang convertor

2019-01-14 Thread Jason E. Aten
I came across this C to Go project. If you could revive the LLVM C output you could compile C++ to C with LLVM and then apply it. https://github.com/elliotchance/c2go It's rough/incomplete but it might give you something useful. -- You received this message because you are subscribed to the

[go-nuts] go1.12beta2 massively slower?

2019-01-14 Thread Jason E. Aten
Has anyone else tried the 1.12betas and found them painfully slow to compile with? I think 1.12beta2 is faster than 1.12beta1, but it is still 2.8x slower than go1.10.7 on my machine. I filed https://github.com/golang/go/issues/29743 with exact repro details. -- You received this message

Re: [go-nuts] performance optimization

2019-01-14 Thread Tamás Király
thanks for the suggestions and notes, i threw out the loop, save the start timestamp and call time.Now()-start when i need the value which is in the second range. - Tamás David Anderson ezt írta (időpont: 2019. jan. 14., H, 21:54): > Note that even for a state of the art CPU, there's only a

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread Philip Nelson
You can't copy from outside the context but you can volume mount it. In my docker-compose.yml I have the following for a golang:1.11-alpine image derivative: ``` volumes: - ${GOPATH}:/go ``` Phil I `RUN go mod download` before copying my source On Monday, January 14, 2019 at 8:49:05

Re: [go-nuts] What's the best way to detect if CGO is enabled?

2019-01-14 Thread Ian Lance Taylor
On Mon, Jan 14, 2019 at 3:26 PM wrote: > > Whether CGO is enabled or not affects how reliable certain standard library > functions are. For example, os/user.LookupGroupId is untrustworthy if CGO is > not enabled (example 1, example 2). > > I can use build flags and two separate source files to

[go-nuts] What's the best way to detect if CGO is enabled?

2019-01-14 Thread twpayne
Whether CGO is enabled or not affects how reliable certain standard library functions are. For example, os/user.LookupGroupId is untrustworthy if CGO is not enabled (example 1 , example 2 ). I can use

[go-nuts] Re: Golang 1.11 Windows Support

2019-01-14 Thread peterGo
Discontinuation of support for Go and Windows XP and Vista has the usual meaning. If you encounter a problem, neither the Go team nor Microsoft will help. You are on your own. Peter On Monday, January 14, 2019 at 1:25:07 PM UTC-5, Subramanian Sridharan wrote: > > Hello Gophers! > > I read

Re: [go-nuts] performance optimization

2019-01-14 Thread David Anderson
Note that even for a state of the art CPU, there's only a few thousand instructions in a microsecond (1000 cycles per microsecond per GHz). At that kind of performance, anything you do that involves the OS or context-switching will make it impossible to hit your target refresh rate. The closest

Re: [go-nuts] performance optimization

2019-01-14 Thread robert engels
If you are going to use time.Now() and a ‘change loop’, you should probably lock the thread to the Go routine to avoid an scheduler thrashing. > On Jan 14, 2019, at 2:34 PM, Tamás Király wrote: > > I'm simulating the internal clock of an embedded microcontroller... And this > sentence (and

Re: [go-nuts] performance optimization

2019-01-14 Thread Tamás Király
I'm simulating the internal clock of an embedded microcontroller... And this sentence (and you!) gave the idea to use time.Now(). Thanks! Tamas 9. jan. 14., H 21:12 dátummal Matt Ho ezt írta: > Can you describe what task it is that needs to be updated every > microsecond? It seems like there

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Matt Ho
Would you mind also posting the network tuning parameters you're using along with the os? I know that when I do perf testing for go on linux, I typically need to update a number of tcp related kernel parameters before I get meaningful numbers. M -- You received this message because you are

Re: [go-nuts] performance optimization

2019-01-14 Thread Matt Ho
Can you describe what task it is that needs to be updated every microsecond? It seems like there should be a better to resolve the underlying need. M -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Golang 1.11 Windows Support

2019-01-14 Thread Jan Mercl
Not supported OS version means IMO: may not work at all as we're not testing it and bugs specific to that OS version will get very low or zero attention. On Mon, Jan 14, 2019, 19:25 Subramanian Sridharan wrote: > Hello Gophers! > > I read that Go 1.11 onwards, Windows XP and Vista aren't

[go-nuts] Golang 1.11 Windows Support

2019-01-14 Thread Subramanian Sridharan
Hello Gophers! I read that Go 1.11 onwards, Windows XP and Vista aren't supported. But when I cross compiled using GOOS and GOARCH, the exe file runs fine on XP system. So does that mean the support for XP and Vista has been discontinued only for development and compiled exes will run fine on

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread Michael Poindexter
Just as a data point, at my work we're using the `go mod vendor` / `go build -mod=vendor` route for exactly the reasons you mention, and it works quite well. On Mon, Jan 14, 2019 at 8:49 AM wrote: > On Saturday, January 12, 2019 at 5:57:19 PM UTC-8, Sam Whited wrote: >> >> On Fri, Jan 11, 2019,

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread gregoryh
On Saturday, January 12, 2019 at 5:57:19 PM UTC-8, Sam Whited wrote: > > On Fri, Jan 11, 2019, at 23:03, greg...@unity3d.com wrote: > > But now, I don't know how I can essentially copy the mod cache (or > > whatever the right term is) like I'd have copied the vendor directory. > > If you're

[go-nuts] Re: Arrays

2019-01-14 Thread peterGo
John, Here is a simple proof-of-concept implementation. Playground: https://play.golang.org/p/Hd0dmazXI5v Output: 11 12 13 14 21 22 23 24 31 32 33 34 XX 12 13 14 21 XX 23 24 31 32 XX 34 Peter On Monday, January 14, 2019 at 12:47:50 AM UTC-5, John wrote: > > Dear Gophers, > >

[go-nuts] go/types: check if *ast.Ident is a function parameter

2019-01-14 Thread Pierre Durand
Hello ! I'm trying to write a tool that will: - parse my code, and find variable assignment - check if the assigned variable is a parameter in the current function (or a function parameter in the current scope) func myFunc(a *A){ a.foo = "bar" } In the code above, I want to detect that "a"

Re: [go-nuts] what is the use of context in golang RESTful apis?

2019-01-14 Thread robert engels
I mostly concur - Go really needs TLS - simplifies this sort of thing. You can look at many “complex” Java based server systems and the method calls are far simpler in the common case (especially when using a framework that leverages TLS). I think a key issue is that most ‘requests’ are not

[go-nuts] Re: Arrays

2019-01-14 Thread Yamil Bracho
It could be : a := [3][4]string{"1 1", "1 2", "1 3", "1 4", "2 1", "2 2", "2 3", "2 4", "3 1", "3 2", "3 3", "3 4" } or var a = [3][4]string for (row = 0; row < 3; row++) { for (col = 0; col < 4; col++) { a[row][col] = fmt.Sprintf("%d %d", (row+1), (col+1) } } El lunes, 14 de

Re: [go-nuts] Re: binary protocols code generators (parser/writer/validator/[de]serializer)

2019-01-14 Thread Robert Engels
He stated that protobufs would only be 50% for existing formats... no need to pounce. On Jan 14, 2019, at 4:04 AM, Dmitry Ponyatov wrote: >> Protocol Buffers springs to mind. > > Totally wrong. Protocol Buffers unable to parse TIFF or STEP file. > > -- > You received this message because

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Kasun Vithanage
Sure, will post when i do it. Will open a new thread then :) On Monday, January 14, 2019 at 7:49:36 PM UTC+5:30, Rodolfo Azevedo wrote: > > Please, when you finish your workerpool can you share your code to me? I > need to understand this. > > Thanks and Regards > > Rodolfo Azevedo > > Em seg,

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Rodolfo
Please, when you finish your workerpool can you share your code to me? I need to understand this. Thanks and Regards Rodolfo Azevedo Em seg, 14 de jan de 2019 às 10:16, Kasun Vithanage escreveu: > I've deleted original post because it seems a problem with my code, will > try to use a

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Kasun Vithanage
I've deleted original post because it seems a problem with my code, will try to use a WorkerPool and see the result :) Thanks for support On Monday, January 14, 2019 at 6:38:27 PM UTC+5:30, Jesper Louis Andersen wrote: > > This might not be due to Go, but rather due to a resource limit imposed

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Kasun Vithanage
I would also try to test the load on a different host too. On Monday, January 14, 2019 at 6:38:27 PM UTC+5:30, Jesper Louis Andersen wrote: > > This might not be due to Go, but rather due to a resource limit imposed by > the operating system: > > # 5000. *. (1. -. 0.1954);; > - : float = 4023.

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Kasun Vithanage
I was wondering about it too, but I see Sun's HTTP Server can handle almost every request with even some work load under the same machine. It uses a ThreadPool for the task while go uses goroutines. On Monday, January 14, 2019 at 6:38:27 PM UTC+5:30, Jesper Louis Andersen wrote: > > This might

Re: [go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Jesper Louis Andersen
This might not be due to Go, but rather due to a resource limit imposed by the operating system: # 5000. *. (1. -. 0.1954);; - : float = 4023. This is close to 4096, assuming a constant factor of other stuff needing resources. Also, as a first step, I'd recommend running your load generator on a

[go-nuts] How to increase concurrent users in net/http

2019-01-14 Thread Kasun Vithanage
I'm doing a simple load test with Apache JMeter. My ambition was to benchmark a go server. Here is the code I've been using, its a simple web server package main import ( "fmt" "log" "net/http" "runtime" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "welcome")

[go-nuts] Re: binary protocols code generators (parser/writer/validator/[de]serializer)

2019-01-14 Thread Ronny Bangsund
Protocol Buffers springs to mind. It's a compact binary protocol with predefined field order, allowing you to skip unused fields and maintain backwards compatibility. You could probably use it as a storage format too. It's not in the Lex/Yacc territory, but it DOES generate all the code you