手元だと、yarv の方が ruby-1.9 より 1.6〜1.8倍くらい速いです。同じマシンで ab も走らせた手抜きベンチマークですが。CPU は Celeron 2.60GHz。
$ cat ws.rb
require 'webrick'
include WEBrick
s = HTTPServer.new({
:Port => 2000,
:DocumentRoot => Dir::pwd,
:Logger => Log.new(nil, -1),
:AccessLog => [[File.open('/dev/null', 'a+'), '']],
})
trap("INT"){ s.shutdown }
s.start
$ head -c 2048 /dev/urandom | mimencode > hoge
$ ab -n 200 -c 10 http://127.0.0.1:2000/hoge
# ruby-1.9 の結果 Server Software: WEBrick/1.3.1 Server Hostname: 127.0.0.1 Server Port: 2000 Document Path: /hoge Document Length: 2770 bytes Concurrency Level: 10 Time taken for tests: 2.290935 seconds Complete requests: 200
# yarv の結果 Server Software: WEBrick/1.3.1 Server Hostname: 127.0.0.1 Server Port: 2000 Document Path: /hoge Document Length: 2770 bytes Concurrency Level: 10 Time taken for tests: 1.328412 seconds Complete requests: 200
正しい Winny の使い方を行政が啓もうするしか。
最近のコメント