Skip to content

Commit

Permalink
Merge pull request #14 from heppu/benchmark/golang-fasthttp
Browse files Browse the repository at this point in the history
Added go-fasthttp benchmark
  • Loading branch information
squeaky-pl authored Feb 2, 2017
2 parents b8c4dd7 + 69a6180 commit f3311fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benchmarks/golang-fasthttp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```
go build .
GOMAXPROCS=1 ./bin
```
16 changes: 16 additions & 0 deletions benchmarks/golang-fasthttp/micro.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import "github.com/valyala/fasthttp"

func hello(ctx *fasthttp.RequestCtx) {
if string(ctx.Path()) != "/" {
ctx.SetStatusCode(404)
ctx.WriteString("Not Found")
return
}
ctx.WriteString("Hello world!")
}

func main() {
fasthttp.ListenAndServe("0.0.0.0:8080", hello)
}

0 comments on commit f3311fa

Please sign in to comment.