about summary refs log tree commit homepage
path: root/test/benchmark/big_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/benchmark/big_request.rb')
-rw-r--r--test/benchmark/big_request.rb44
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
-