about summary refs log tree commit homepage
path: root/test/benchmark/request.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-14 21:03:41 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-15 02:36:30 -0700
commit6096fc8d0c5e61a4342d5ccd0ff9df0213e8c062 (patch)
treed3059dc9d47c73d4e579c54b5fc7c534d4ed711c /test/benchmark/request.rb
parent60f9bcd4ba54d84a4b2e2cd621d5995ddf206ace (diff)
downloadunicorn-6096fc8d0c5e61a4342d5ccd0ff9df0213e8c062.tar.gz
It's not worth the effort to keep the internal API consistent
between non-bugfix versions.
Diffstat (limited to 'test/benchmark/request.rb')
-rw-r--r--test/benchmark/request.rb56
1 files changed, 0 insertions, 56 deletions
diff --git a/test/benchmark/request.rb b/test/benchmark/request.rb
deleted file mode 100644
index fc7822c..0000000
--- a/test/benchmark/request.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'benchmark'
-require 'unicorn'
-nr = ENV['nr'] ? ENV['nr'].to_i : 100000
-
-class TestClient
-  def initialize(response)
-    @response = (response.join("\r\n") << "\r\n\r\n").freeze
-  end
-  def sysread(len, buf)
-    buf.replace(@response)
-  end
-
-  alias readpartial sysread
-
-  # old versions of Unicorn used this
-  def unicorn_peeraddr
-    '127.0.0.1'
-  end
-end
-
-small = TestClient.new([
-  'GET / HTTP/1.0',
-  'Host: localhost',
-  'Accept: */*',
-  'User-Agent: test-user-agent 0.1.0'
-])
-
-medium = TestClient.new([
-  'GET /hello/world/geturl?abcd=efg&hi#anchor HTTP/1.0',
-  'Host: localhost',
-  'Accept: */*',
-  'User-Agent: test-user-agent 0.1.0 (Mozilla compatible) 5.0 asdfadfasda'
-])
-
-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("small") do
-    for i in 1..nr
-      request.read(small)
-      request.reset
-    end
-  end
-  x.report("medium") do
-    for i in 1..nr
-      request.read(medium)
-      request.reset
-    end
-  end
-end