Created
September 11, 2014 03:15
-
-
Save acmacalister/a60a47d9f1c06a14c00f to your computer and use it in GitHub Desktop.
Go vs Sinatra vs Rack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ============================ | |
| Go | |
| ============================ | |
| Server Software: | |
| Server Hostname: 127.0.0.1 | |
| Server Port: 8080 | |
| Document Path: /hi | |
| Document Length: 12 bytes | |
| Concurrency Level: 100 | |
| Time taken for tests: 0.568 seconds | |
| Complete requests: 10000 | |
| Failed requests: 0 | |
| Write errors: 0 | |
| Total transferred: 1290000 bytes | |
| HTML transferred: 120000 bytes | |
| Requests per second: 17602.04 [#/sec] (mean) | |
| Time per request: 5.681 [ms] (mean) | |
| Time per request: 0.057 [ms] (mean, across all concurrent requests) | |
| Transfer rate: 2217.44 [Kbytes/sec] received | |
| Connection Times (ms) | |
| min mean[+/-sd] median max | |
| Connect: 1 3 0.5 3 4 | |
| Processing: 2 3 0.5 3 7 | |
| Waiting: 2 3 0.5 3 7 | |
| Total: 3 6 0.8 6 10 | |
| ============================ | |
| Sinatra | |
| ============================ | |
| Server Software: thin | |
| Server Hostname: 127.0.0.1 | |
| Server Port: 4567 | |
| Document Path: /hi | |
| Document Length: 12 bytes | |
| Concurrency Level: 100 | |
| Time taken for tests: 4.468 seconds | |
| Complete requests: 10000 | |
| Failed requests: 0 | |
| Write errors: 0 | |
| Total transferred: 2431701 bytes | |
| HTML transferred: 120084 bytes | |
| Requests per second: 2238.25 [#/sec] (mean) | |
| Time per request: 44.678 [ms] (mean) | |
| Time per request: 0.447 [ms] (mean, across all concurrent requests) | |
| Transfer rate: 531.52 [Kbytes/sec] received | |
| Connection Times (ms) | |
| min mean[+/-sd] median max | |
| Connect: 0 0 0.3 0 2 | |
| Processing: 15 44 9.0 40 102 | |
| Waiting: 12 41 9.0 36 102 | |
| Total: 16 44 8.9 41 102 | |
| ============================ | |
| Rack | |
| ============================ | |
| Server Software: thin | |
| Server Hostname: 127.0.0.1 | |
| Server Port: 3000 | |
| Document Path: /hi | |
| Document Length: 12 bytes | |
| Concurrency Level: 100 | |
| Time taken for tests: 1.173 seconds | |
| Complete requests: 10000 | |
| Failed requests: 0 | |
| Write errors: 0 | |
| Total transferred: 1340000 bytes | |
| HTML transferred: 120000 bytes | |
| Requests per second: 8528.01 [#/sec] (mean) | |
| Time per request: 11.726 [ms] (mean) | |
| Time per request: 0.117 [ms] (mean, across all concurrent requests) | |
| Transfer rate: 1115.97 [Kbytes/sec] received | |
| Connection Times (ms) | |
| min mean[+/-sd] median max | |
| Connect: 0 0 0.3 0 3 | |
| Processing: 3 11 11.9 9 126 | |
| Waiting: 2 11 11.3 8 125 | |
| Total: 3 12 11.9 9 126 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # thin start -e production -R rack.ru | |
| app = proc do |env| | |
| [ | |
| 200, # Status code | |
| { # Response headers | |
| 'Content-Type' => 'text/html', | |
| 'Content-Length' => '12', | |
| }, | |
| ['Hello World!'] # Response body | |
| ] | |
| end | |
| run app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Using thin. | |
| require 'sinatra' | |
| get '/hi' do | |
| "Hello World!" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Running go run ws.go | |
| package main | |
| import ( | |
| "net/http" | |
| ) | |
| func main() { | |
| http.HandleFunc("/hi", hiHandler) | |
| http.ListenAndServe(":8080", nil) | |
| } | |
| func hiHandler(rw http.ResponseWriter, req *http.Request) { | |
| rw.Write([]byte("Hello World!")) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment