Ruby On Rails Application Performance Optimization Tutorial

  • For checking the precise speed of application pages run the application in production mode.
  • check the disable cache from browser console. This will completely disable the Google Chrome cache
  • Database Performance
# app/controllers/users_controller.rb
class UsersController < ApplicationController
def index
@ users = User.includes(:addresses).all
end
...
...
end
## this should produce 2 queries on the same 100 customers.ii) Add index on the N+1 queries:
class AddIndexForUser
def change
add_index :users, :users_id
end
end
## example migration file to add index
  • Replace Http requests with local files
  • Use Pagy for Pagination

--

--

--

Cryptex specializes in developing open source web applications and software solutions across all domains and verticals using Ruby on Rails (ROR) technology

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Chingu Weekly Vol. 27

Choosing a Backend Tech Stack in 2018

Cross Repository Maven-based Test Execution using GitHub Action Workflow

Exploring the Binance API in Python — Part I: The Orderbook

Here Comes the BOOM!

Writing beautiful documentations with Docusaurus

Hyper V — Windows Server 2019 with ADFS — VM setup

MicroZed Chronicles: Tips and Tricks When Working with HLS — Part Two

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cryptex Technologies

Cryptex Technologies

Cryptex specializes in developing open source web applications and software solutions across all domains and verticals using Ruby on Rails (ROR) technology

More from Medium

Everything is “Enumerable” in Ruby

Rails Authentication & Authorization

How to Implement Elasticsearch with rails

implement-elasticsearch-rails

Ruby: Active Record Overview