diff --git a/config/environments/profile.rb b/config/environments/profile.rb index 4e2a17136..6047a697a 100644 --- a/config/environments/profile.rb +++ b/config/environments/profile.rb @@ -1,6 +1,8 @@ Discourse::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = true if rails4? + # Code is not reloaded between requests config.cache_classes = true diff --git a/script/bench.rb b/script/bench.rb index 41e0f392e..208db4f90 100644 --- a/script/bench.rb +++ b/script/bench.rb @@ -93,13 +93,13 @@ puts "Populating Profile DB" run("bundle exec ruby script/profile_db_generator.rb") puts "Getting api key" -api_key = `bundle exec rake api_key:get` +api_key = `bundle exec rake api_key:get`.split("\n")[-1] def bench(path) puts "Running apache bench warmup" - `ab -n 100 http://127.0.0.1:#{@port}#{path}` + `ab -n 100 "http://127.0.0.1:#{@port}#{path}"` puts "Benchmarking #{path}" - `ab -n 100 -e tmp/ab.csv http://127.0.0.1:#{@port}#{path}` + `ab -n 100 -e tmp/ab.csv "http://127.0.0.1:#{@port}#{path}"` percentiles = Hash[*[50, 75, 90, 99].zip([]).flatten] CSV.foreach("tmp/ab.csv") do |percent, time| @@ -128,6 +128,7 @@ begin topic_page = bench("/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69") append = "?api_key=#{api_key}&api_username=admin1" + home_page_admin = bench("/#{append}") topic_page_admin = bench("/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69#{append}")