#98 Request Profiling

You can use profiling to determine where the performance bottlenecks are in specific Rails actions. Watch this episode for details.
# config/environments/staging.rb
config.cache_classes = true
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true

config.log_level = :debug

# lib/products_index_profiler.rb
get '/products'
say "GET #{path}"

$ script/server -e staging
$ sudo gem install ruby-prof
$ RAILS_ENV=staging script/performance/request lib/products_index_profiler.rb
發佈了108 篇原創文章 · 獲贊 0 · 訪問量 2932
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章