diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-14 21:03:41 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-15 02:36:30 -0700 |
commit | 6096fc8d0c5e61a4342d5ccd0ff9df0213e8c062 (patch) | |
tree | d3059dc9d47c73d4e579c54b5fc7c534d4ed711c /test/benchmark/big_request.rb | |
parent | 60f9bcd4ba54d84a4b2e2cd621d5995ddf206ace (diff) | |
download | unicorn-6096fc8d0c5e61a4342d5ccd0ff9df0213e8c062.tar.gz |
It's not worth the effort to keep the internal API consistent between non-bugfix versions.
Diffstat (limited to 'test/benchmark/big_request.rb')
-rw-r--r-- | test/benchmark/big_request.rb | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/test/benchmark/big_request.rb b/test/benchmark/big_request.rb deleted file mode 100644 index a250c62..0000000 --- a/test/benchmark/big_request.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'benchmark' -require 'tempfile' -require 'unicorn' -nr = ENV['nr'] ? ENV['nr'].to_i : 100 -bs = ENV['bs'] ? ENV['bs'].to_i : (1024 * 1024) -count = ENV['count'] ? ENV['count'].to_i : 4 -length = bs * count -slice = (' ' * bs).freeze - -big = Tempfile.new('') - -def big.unicorn_peeraddr # old versions of Unicorn used this - '127.0.0.1' -end - -big.syswrite( -"PUT /hello/world/puturl?abcd=efg&hi#anchor HTTP/1.0\r\n" \ -"Host: localhost\r\n" \ -"Accept: */*\r\n" \ -"Content-Length: #{length}\r\n" \ -"User-Agent: test-user-agent 0.1.0 (Mozilla compatible) 5.0 asdfadfasda\r\n" \ -"\r\n") -count.times { big.syswrite(slice) } -big.sysseek(0) -big.fsync - -include Unicorn -request = HttpRequest.new(Logger.new($stderr)) -unless request.respond_to?(:reset) - def request.reset - # no-op - end -end - -Benchmark.bmbm do |x| - x.report("big") do - for i in 1..nr - request.read(big) - request.reset - big.sysseek(0) - end - end -end - |