Skip to content

Commit

Permalink
Merge pull request #66 from tbrand/chart
Browse files Browse the repository at this point in the history
Chart
  • Loading branch information
tbrand authored Sep 3, 2017
2 parents 1af51ae + 358df50 commit fd99197
Show file tree
Hide file tree
Showing 13 changed files with 230 additions and 94 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ kemal:
cd crystal/kemal; shards build --release
ln -s -f ../crystal/kemal/bin/server_crystal_kemal bin/.

# Raze
raze:
cd crystal/raze; shards build --release
ln -s -f ../crystal/raze/bin/server_crystal_raze bin/.

# router.cr
router_cr:
cd crystal/router.cr; shards build --release
Expand All @@ -70,6 +75,11 @@ gorilla-mux:
cd go/gorilla-mux; go build -o server_go_gorilla_mux main.go
ln -s -f ../go/gorilla-mux/server_go_gorilla_mux bin/.

iris:
go get -u github.com/kataras/iris
cd go/iris; go build -o server_go_iris.go
ln -s -f ../go/iris/server_go_iris bin/.

# fasthttprouter
fasthttprouter:
go get -u github.com/buaazp/fasthttprouter
Expand Down
83 changes: 82 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,78 @@ Each framework has to have two features; routing and parsing path parameters.

## Result

[HERE](https://github.com/tbrand/which_is_the_fastest/tree/master/res)
<!-- Result from here -->
Last update: 2017-09-04

### Ranking (Framework)

1. [router_cr](https://github.com/tbrand/router.cr)
2. [raze](https://github.com/samueleaton/raze)
3. [fasthttprouter](https://github.com/buaazp/fasthttprouter)
4. [iron](https://github.com/iron/iron)
5. [japronto](https://github.com/squeaky-pl/japronto)
6. [nickel](https://github.com/nickel-org/nickel.rs)
7. [kemal](https://github.com/kemalcr/kemal)
8. [rocket](https://github.com/SergioBenitez/Rocket)
9. [gorilla_mux](https://github.com/gorilla/mux)
10. [echo](https://github.com/labstack/echo)
11. [iris](https://github.com/kataras/iris)
12. [plug](https://github.com/elixir-lang/plug)
13. [vapor](https://github.com/vapor/vapor)
14. [phoenix](https://github.com/phoenixframework/phoenix)
15. [aspnetcore](https://github.com/aspnet/Home)
16. [sanic](https://github.com/channelcat/sanic)
17. [perfect](https://github.com/PerfectlySoft/Perfect)
18. [akkahttp](https://github.com/akka/akka-http)
19. [clusterexpress](https://github.com/LearnBoost/cluster)
20. [express](https://github.com/expressjs/express)
21. [roda](https://github.com/jeremyevans/roda)
22. [kitura](https://github.com/IBM-Swift/Kitura)
23. [sinatra](https://github.com/sinatra/sinatra)
24. [rails](https://github.com/rails/rails)

### Ranking (Language)

1. crystal ([router_cr](https://github.com/tbrand/router.cr))
2. go ([fasthttprouter](https://github.com/buaazp/fasthttprouter))
3. rust ([iron](https://github.com/iron/iron))
4. python ([japronto](https://github.com/squeaky-pl/japronto))
5. elixir ([plug](https://github.com/elixir-lang/plug))
6. swift ([vapor](https://github.com/vapor/vapor))
7. csharp ([aspnetcore](https://github.com/aspnet/Home))
8. scala ([akkahttp](https://github.com/akka/akka-http))
9. node ([clusterexpress](https://github.com/LearnBoost/cluster))
10. ruby ([roda](https://github.com/jeremyevans/roda))

### All frameworks

| Language (Runtime) | Framework (Middleware) | Max [sec] | Min [sec] | Ave [sec] |
|---------------------------|---------------------------|-----------------|-----------------|-----------------|
| ruby | rails | 754.063778 | 708.440793 | 736.451491 |
| ruby | sinatra | 50.935940 | 46.196863 | 48.511964 |
| ruby | roda | 17.978084 | 17.067853 | 17.600964 |
| crystal | kemal | 4.005528 | 3.876987 | 3.913506 |
| crystal | router_cr | 3.022270 | 2.776481 | 2.865556 |
| crystal | raze | 3.527649 | 2.899719 | 3.052073 |
| go | echo | 4.565017 | 4.332744 | 4.458838 |
| go | gorilla_mux | 4.783134 | 4.195671 | 4.391958 |
| go | iris | 4.870891 | 4.431526 | 4.719329 |
| go | fasthttprouter | 3.426500 | 2.982375 | 3.178191 |
| rust | iron | 3.616533 | 3.052602 | 3.307757 |
| rust | nickel | 3.437849 | 3.268217 | 3.353121 |
| rust | rocket | 4.486677 | 4.151858 | 4.390674 |
| node | express | 16.297716 | 15.355201 | 15.641189 |
| node | clusterexpress | 10.272147 | 8.916303 | 9.505865 |
| elixir | plug | 5.617337 | 5.169207 | 5.361000 |
| elixir | phoenix | 5.738947 | 5.306468 | 5.575212 |
| swift | vapor | 5.659526 | 5.240323 | 5.475122 |
| swift | perfect | 6.973852 | 6.734707 | 6.826379 |
| swift | kitura | 19.664970 | 17.669080 | 18.878266 |
| scala | akkahttp | 10.572538 | 8.800646 | 9.409009 |
| csharp | aspnetcore | 5.886491 | 5.307668 | 5.608353 |
| python | sanic | 6.955599 | 5.493192 | 6.356439 |
| python | japronto | 3.375258 | 3.138797 | 3.315764 |
<!-- Result till here -->

## Current target frameworks (middlewares)

Expand All @@ -15,10 +86,12 @@ Each framework has to have two features; routing and parsing path parameters.
- [Roda](https://github.com/jeremyevans/roda)
- Crystal
- [Kemal](https://github.com/kemalcr/kemal)
- [raze](https://github.com/samueleaton/raze)
- [router.cr](https://github.com/tbrand/router.cr)
- Go
- [Echo](https://github.com/labstack/echo)
- [gorilla-mux](https://github.com/gorilla/mux)
- [iris](https://github.com/kataras/iris)
- [fasthttprouter](https://github.com/buaazp/fasthttprouter)
- Rust
- [IRON](https://github.com/iron/iron)
Expand Down Expand Up @@ -166,3 +239,11 @@ Anyway, you don't have to care about details since maintainer can fix them after

- [tbrand](https://github.com/tbrand) Taichiro Suzuki - creator, maintainer
- [OvermindDL1](https://github.com/OvermindDL1) OvermindDL1 - maintainer

## Donate

```
1AE9P6TUVik1rJGQhaSqGWRk1oAQ3DJnmo
```

![QRCode](https://user-images.githubusercontent.com/3483230/30004198-ccfeb086-9105-11e7-821c-927e4aa7af70.png)
3 changes: 3 additions & 0 deletions crystal/raze/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/lib/
/.shards/
/bind/
10 changes: 10 additions & 0 deletions crystal/raze/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM crystallang/crystal

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app

RUN shards build --release

CMD ./bin/server_crystal_raze
Binary file added crystal/raze/bin/server_crystal_raze
Binary file not shown.
14 changes: 14 additions & 0 deletions crystal/raze/shard.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 1.0
shards:
kilt:
github: jeromegn/kilt
version: 0.4.0

radix:
github: luislavena/radix
version: 0.3.8

raze:
github: samueleaton/raze
version: 0.1.0

17 changes: 17 additions & 0 deletions crystal/raze/shard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: raze
version: 0.1.0

authors:
- tbrand <[email protected]>

targets:
server_crystal_raze:
main: src/server.cr

dependencies:
raze:
github: samueleaton/raze

crystal: 0.22.0

license: MIT
16 changes: 16 additions & 0 deletions crystal/raze/src/server.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require "raze"

get "/" do |ctx|
nil
end

get "/user/:id" do |ctx|
ctx.params["id"].as(String)
end

post "/user" do |ctx|
nil
end

Raze.config.port = 3000
Raze.run
25 changes: 25 additions & 0 deletions go/iris/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"github.com/kataras/iris"
"github.com/kataras/iris/context"
)

func main() {
app := iris.New()

app.Get("/", func(ctx context.Context) {
ctx.WriteString("")
})

app.Get("/user/{id}", func(ctx context.Context) {
p := ctx.Params().Get("id")
ctx.WriteString(p)
})

app.Post("/user", func(ctx context.Context) {
ctx.WriteString("")
})

app.Run(iris.Addr(":3000"))
}
Binary file added go/iris/server_go_iris
Binary file not shown.
17 changes: 17 additions & 0 deletions neph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@ crystal:
depends_on:
- kemal
- router_cr
- raze

kemal:
command: |
shards build --release
ln -s -f ../crystal/kemal/bin/server_crystal_kemal ../../bin/.
dir:
crystal/kemal

raze:
command: |
shards build --release
ln -s -f ../crystal/raze/bin/server_crystal_raze ../../bin/.
dir:
crystal/raze

router_cr:
command: |
Expand All @@ -85,6 +93,7 @@ go:
- echo
- gorilla-mux
- fasthttprouter
- iris

echo:
command: |
Expand All @@ -101,6 +110,14 @@ gorilla-mux:
ln -s -f ../go/gorilla-mux/server_go_gorilla_mux ../../bin/.
dir:
go/gorilla-mux

iris:
command: |
go get -u github.com/kataras/iris
go build -o server_go_iris main.go
ln -s -f ../go/iris/server_go_iris ../../bin/.
dir:
go/iris

fasthttprouter:
command: |
Expand Down
68 changes: 0 additions & 68 deletions res/README.md

This file was deleted.

Loading

0 comments on commit fd99197

Please sign in to comment.