Created
August 5, 2011 20:25
-
-
Save kyledrake/1128433 to your computer and use it in GitHub Desktop.
Rubinius day web server parallelism benchmarking tests
This file contains 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
### TEST 1: Simple Rack app RAW AND DUMB | |
class HelloRubinius | |
def call(env) | |
return [ | |
200, | |
{'Content-Type' => 'text/html'}, | |
['Hello #rbxday!'] | |
] | |
end | |
end | |
run HelloRubinius.new | |
# Test with: Webrick, Mongrel, Thin, Unicorn, Rainbows (ThreadPool), Rainbows(ThreadSpawn), Rainbows(EventMachine) | |
### TEST 2: Sinatra RAW AND DUMB | |
get '/' do | |
'Hello #rbxday!' | |
end | |
# Test with: Webrick, Mongrel, Thin, Unicorn, Rainbows (ThreadPool), Rainbows(ThreadSpawn), Rainbows(EventMachine) | |
### TEST 3: SLEEPER | |
# FOR THREADS: | |
get '/' do | |
sleep 1 | |
'ok' | |
end | |
# Test with: Webrick, Mongrel, Unicorn, Rainbows(ThreadPool), Rainbows(ThreadSpawn) | |
# FOR EM: | |
get '/' do | |
EM.sleep 1 | |
'ok' | |
end | |
# Test with: Thin, Rainbows(EM) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment