We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Fix the dispatcher benchmark program.
Hongli Lai (Phusion) (author)
Mon Aug 18 04:46:38 -0700 2008
commit  274d05b6c8a85f66b79f0ec8338f7cfcd51f0939
tree    a2695f7ca54a02e69e7450a5b1150596681f3ad2
parent  4998ceab297d2128fc45fc9e9a01833b384fd518
...
2
3
4
 
5
6
7
8
9
10
 
11
12
13
14
15
16
17
...
25
26
27
28
 
29
30
31
...
39
40
41
42
43
44
45
46
 
 
...
2
3
4
5
6
7
8
9
 
10
11
12
13
 
 
14
15
16
...
24
25
26
 
27
28
29
30
...
38
39
40
 
 
 
 
 
41
42
0
@@ -2,16 +2,15 @@
0
 # Benchmark raw speed of the Rails dispatcher.
0
 PASSENGER_ROOT = File.expand_path("#{File.dirname(__FILE__)}/..")
0
 $LOAD_PATH << "#{PASSENGER_ROOT}/lib"
0
+$LOAD_PATH << "#{PASSENGER_ROOT}/ext"
0
 ENV["RAILS_ENV"] = "production"
0
 
0
 require 'yaml'
0
 require 'benchmark'
0
-require 'passenger/request_handler'
0
 require 'config/environment'
0
+require 'passenger/railz/cgi_fixed'
0
 require 'dispatcher'
0
 
0
-include Passenger
0
-
0
 class OutputChannel
0
   def write(data)
0
     # Black hole
0
@@ -25,7 +24,7 @@ def start(iterations)
0
   milestone = 1 if milestone == 0
0
   result = Benchmark.measure do
0
     iterations.times do |i|
0
- cgi = CGIFixed.new(headers, output, STDOUT)
0
+ cgi = Passenger::Railz::CGIFixed.new(headers, output, output)
0
       ::Dispatcher.dispatch(cgi,
0
         ::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS,
0
         cgi.stdoutput)
0
@@ -39,8 +38,5 @@ def start(iterations)
0
 end
0
 
0
 puts "Benchmark started."
0
-t = Thread.new do
0
- #start(ARGV[0] ? ARGV[0].to_i : 1000)
0
-end
0
-start(ARGV[0] ? ARGV[0].to_i : 1000)
0
-t.join
0
+start(ARGV[0] ? ARGV[0].to_i : 2000)
0
+

Comments

    No one has commented yet.