-
Notifications
You must be signed in to change notification settings - Fork 1
Performance Monitoring
- 42 Performance Optimization Tips for RoR
- the Best Way to Lazy Load Images for Maximum Performance
- Compressor.io (Optimize JPGs and PNGs)
- PagerDuty: Growing a Rails App - How we made deploy fast again
- PageSpeed Insights
- Active Record Queries: Don't need the whole object? Just select the part you want. Need several relational objects? Select them all at once, instead of doing separate queries.
- never use exceptions as flow control. They are up to 32x slower.
This gem should be included in all our apps, and enabled in production - partially because our dev environments are different from production, and also because it is designed for production use. It can be restricted by user role, and it can be set to hidden unless someone explicitly wants to see it.
# use option/p to toggle
Rack::MiniProfiler.config.start_hidden = true
This gem will show a speed badge in the top left corner. Clicking that gives you access to information about sql queries, server response times, broken down by partial.
?pp=help
at the end of a query on any page will show you a complete list of features and how to trigger them.
This is an optional add to the mini-rack-profiler gem. ?pp=flamegraph
will show you a flamegraph of where time was spent in the app, with the x axis being time, and the y axis being how deep in the stack it happened.
Another optional add to mini-rack-profiler. ?pp=profile-memory
tells us where in code different memory is being allocated
- Bullet: Checks for query optimizations
- lol_dba: rake tasks that scan your application models and displays a list of columns that probably should be indexed
- Metric Fu: A fist full of code metrics
- Ruby Prof: Code profiler - faster, more options than standard ruby profiler
- Skylight: Smart profiler that follows through an action to find the pain points.
- Stack Prof: A sampling call-stack profiler for Rub