Skip to content

Instantly share code, notes, and snippets.

@jdpaton
Created February 27, 2013 08:31
Show Gist options
  • Save jdpaton/5046307 to your computer and use it in GitHub Desktop.
Save jdpaton/5046307 to your computer and use it in GitHub Desktop.
± for i in {1..10}; do ./wrk http://localhost:8000 -c 100 | grep Requests | awk '{print $2}';done | awk '{s+=$1} END {print s}'
5329.22
package main
import "net/http"
func main() {
bytes := make([]byte, 1024*1024)
for i := 0; i < len(bytes); i++ {
bytes[i] = 100
}
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write(bytes)
})
http.ListenAndServe(":8000", nil)
}
http = require('http')
n = 1024*1024;
b = new Buffer(n);
for (var i = 0; i < n; i++) b[i] = 100;
http.createServer(function (req, res) {
res.writeHead(200);
res.write(b);
res.end();
}).listen(8000);
± for i in {1..10}; do ./wrk http://localhost:8000 -c 100 | grep Requests | awk '{print $2}';done | awk '{s+=$1} END {print s}'
9184.36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment