[go-nuts] What is restapiserver.webcache

2018-05-19 Thread asaaveri
All: I have a very simple HelloWorld REST API server in go and a corresponding Go client. The objective is to see benchmark -- i.e. what is the most TPS a Go server can support. I used tcpdumo to see the exchanges. I was expecting to see just my restapiserver:8080 but I see some w/

Re: [go-nuts] Measuring low latency operations

2018-01-16 Thread asaaveri
- I will look into median and for some visual display of the data - Good advice on looking into median and using the benchmarking tool. - I run on virtualized servers but don't know at this point if it is affecting my data. On Monday, January 15, 2018 at 10:04:11 AM UTC-5,

[go-nuts] Measuring low latency operations

2018-01-14 Thread asaaveri
All: I am testing an application that has a latency of the order of few to several microseconds. I wrote a benchmark and measured the performance. I also computed the elapsed time using time.Now() and time.Since(). (I will change this to time,Nanoseconds and try shortly. I found the

[go-nuts] Any "established" code practice for encapsulation

2017-12-30 Thread asaaveri
All: This is mostly for internal i.e. not public struct and interfaces. I have structs but I don't want code to access the fields directly. I want to write some interfaces. I am experimenting with lowercase for struct names and upper case for interface name but hide all accessors. For

[go-nuts] What does the 1st :8 do in -- slice := (*[1 << 30]byte)(unsafe.Pointer())[:8:8]

2017-12-13 Thread asaaveri
All: I saw this example at https://play.golang.org/ in cgo. I don't understand the role of the 1st :8? I tried changing it to 0 and didn't make any difference? I will appreciate any pointers. package main > > >> import ( > > "fmt" > > "unsafe" > > ) > > >> func main() { > > var i uint64 =

[go-nuts] Re: net/http Server Shutdown does not free up the port upon return

2017-12-09 Thread asaaveri
Sockets have something called SO_REUSEADDR. BSD libraries, Java and other support this. I would think Go supports this in some form. On Tuesday, November 28, 2017 at 9:53:48 PM UTC-7, Albert Tedja wrote: > > net/http's Shutdown() does not free up the port upon return, or rather it > seems a

[go-nuts] Re: Is this legit in cgo -- passing []*C.SQL_ERROR_TYPE to C

2017-12-09 Thread asaaveri
Ian: Thanks. In the real environment, t transform the error message into a JSON document and C.free as soon as the transformation is done. The end user will see the proverbial error interface. With regards, mp On Friday, December 8, 2017 at 10:24:45 AM UTC-7, M.P. Ardhanareeswaran wrote: >

[go-nuts] Is this legit in cgo -- passing []*C.SQL_ERROR_TYPE to C

2017-12-08 Thread asaaveri
All: I am able to pass a []*C.SQL_ERROR_TYPE to C, allocate memory for SQL_ERROR_TYPE on the "C" side, populate the structure and access it on the Go side. It works. I tested Mac (High Sierra) and Linux 7, 64 bit. Is this legitimate? Or is it just happenstance that it is working? With

[go-nuts] Re: Newbie cgo question

2017-12-08 Thread asaaveri
Ian: Thanks. mp On Thursday, December 7, 2017 at 9:47:28 AM UTC-7, M.P. Ardhanareeswaran wrote: > > All: > > I am working on a pilot go/cgo project for a database driver. For one of > my C functions called by go, I chose a generic, unfortunate name > connect(). My program kept dumping

[go-nuts] Newbie cgo question

2017-12-07 Thread asaaveri
All: I am working on a pilot go/cgo project for a database driver. For one of my C functions called by go, I chose a generic, unfortunate name connect(). My program kept dumping core on Linux. I did some tracing and found out that my function connect() was being called twice even though I