gaio
gaio copied to clipboard
High performance async-io(proactor) networking for Golang。golangのための高性能非同期io(proactor)ネットワーキング
你好! 我在看代码发现gaio会不区分读写请求,统一都向poller注册EPOLLIN和EPOLLOUT事件,这样会有个问题,比如echo server中在等客户端发数据过来前,会因为这条链接可写被不断唤醒,空转CPU,不知道你怎么看这个问题。
Hi, I am trying to implement a websocket push based server using this library and I am constantly running into OOM for large number of sockets like 3K for example....
复现环境: CentOS release 6.3 (Final) go version go1.15.2 linux/amd64 ------------------------- 报错信息如下: # github.com/xtaci/gaio cgo: gcc did not produce error at completed:1 on input: #line 1 "cgo-builtin-prolog" #include /* for ptrdiff_t...
profile内存时发现,gaio内部用 list.List 来存放读者/写者的回调上下文,因此每次异步读写(写操作大部分情况就直接tryWrite成功了,所以更多情况是读操作)都会动态创建 list.Element 对象。 其实一般的应用,一个连接只会有1个读请求,或者若干个写请求,readers/writers 的数量相对较少,用slice就可以满足需求。这个PR用slice实现了 cbList 用来代替 list.List,以此优化内存分配次数较多的问题。 
每次调用`WaitIO()`都会新创建一个`[]OpResult`小对象,对性能造成一定影响;这个PR修改了`WaitIO()`的接口,允许用户传入一个预先分配好的slice,从而避免每次重新创建。 ```go buf := make([]gaio.OpResult, 0, 100) for { results, err := w.WaitIO(buf) ... } ``` 甚至用户可以直接重用返回的slice ```go buf := make([]gaio.OpResult, 0, 100) for { results, err := w.WaitIO(buf) for...
When i try to download the package using `go get -u github.com/xtaci/gaio` i recieve the following output: ``` # github.com/xtaci/gaio ..\..\..\..\pkg\mod\github.com\xtaci\[email protected]\aio_generic.go:132:2: undefined: watcher ```
Is this only for TCP or does it support UDP also ?
I love Linux, everything is `fd` in Linux, so I can watch `network connection`, `file`, `event fd`, `timer fd`, `signal fd` etc. in one `epoll/select` loop. I am designing a...
Fix https://github.com/xtaci/gaio/issues/11 .