Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/winlinvip/go-writev
The test example for https://github.com/golang/go/issues/13451
https://github.com/winlinvip/go-writev
Last synced: about 1 month ago
JSON representation
The test example for https://github.com/golang/go/issues/13451
- Host: GitHub
- URL: https://github.com/winlinvip/go-writev
- Owner: winlinvip
- Created: 2015-12-16T05:56:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-21T05:21:45.000Z (about 9 years ago)
- Last Synced: 2024-05-19T00:37:08.096Z (7 months ago)
- Language: Go
- Size: 27.3 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-writev
The prototype program for [golang-writev](https://github.com/golang/go/issues/13451).
## Usage
This program use a tcp server and client to profile the writev, the arch is:
```
+--------+ +---------+
| client +----tcp------+ server +
+--------+ +---------+
```To use private TCPConn.Writev from [winlin](https://github.com/winlinvip/go/tree/go1.5-writev):
```
mkdir -p $GOPATH/src/github.com/winlinvip && cd $GOPATH/src/github.com/winlinvip &&
if [[ ! -d go/src ]]; then echo "get writev go."; git clone https://github.com/winlinvip/go; fi &&
cd go && git checkout go1.5-writev && cd $GOROOT/src && sudo mv net net.`date +%s` &&
sudo ln -sf $GOPATH/src/github.com/winlinvip/go/src/net
```To start the tcp server, use write to send tcp packets:
```
go get -d github.com/winlinvip/go-writev/tcpserver &&
cd $GOPATH/src/github.com/winlinvip/go-writev/tcpserver && go build -a . &&
./tcpserver --port=1985 --writev=false
```Or use writev to send:
```
go get -d github.com/winlinvip/go-writev/tcpserver &&
cd $GOPATH/src/github.com/winlinvip/go-writev/tcpserver && go build -a . &&
./tcpserver --port=1985 --writev=true
```Then, please start the client to recv tcp packets:
```
go get github.com/winlinvip/go-writev/tcpclient &&
$GOPATH/bin/tcpclient --port=1985
```Remarks:
1. Profile: Both server and client will write cpu(cpu.prof) and memory(mem.prof) profile,
user can use `go tool pprof $GOPATH/bin/tcpserver cpu.prof` to profile it.
1. GO sdk: Please use go1.5 and private implementation for [writev](https://github.com/winlinvip/go/pull/1#issuecomment-165943222).
1. Fast build: User can rebuild the golang sdk for this program by `cd $GOPATH/src/github.com/winlinvip/go-writev/tcpserver && go build -a .`## Benchmark
Coming soon...
## Conclude
Coming soon...
Winlin 2015