Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Created December 27, 2019 02:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nateberkopec/0b7014a4e22b385d698df4507911798a to your computer and use it in GitHub Desktop.
Save nateberkopec/0b7014a4e22b385d698df4507911798a to your computer and use it in GitHub Desktop.
Principles
Who were Benford, Pareto, Zipf and Little?
Why is premature optimization bad?
What is benchmarking/profiling?
How to benchmark an HTTP service
Benchmarking
Benchmark and benchmark/ips
What can you benchmark?
What's a good benchmark?
Pitfalls
Scaling Services
Little’s Law
Erlang traffic analysis
Understanding latency/throughput
How to scale any service correctly and identify service bottlenecks
Profiling Memory
Why we profile memory
How Ruby GC works in 5 minutes
The GC Module
Building your own profiler with ObjectSpace
More ObjectSpace tricks
What triggers GC?
Memory myth 1: memory goes down, right?
Heap fragmentation
GC tracing
derailed benchmarks and profiling startup
oink
Profiling the Web Request
rack-mini-profiler
Profiling in production-like environments
Auth with RMP
Understanding the speed badge
SQL
time
Outliers?
Flamegraphs
GC Profiler
Exception profiling
Application Metrics
Why it's fast on your machine
Development mode settings
Latency
Javascript
System config
Virtualization
What's "fast" for Rails
Applying the 80/20 rule
ActiveRecord
Measurement
How to read prod metrics to look for AR issues
Reproducing issues in dev
Diagnosis of N+1
ActiveRecord’s weight
ActiveRecord::QueryCache
Profiling an ActiveRecord query
Removing unnecessary SQL
Preload/includes/eager_load
What “breaks” preloads?
Advanced preloading
Common N+1 traps/scenarios
Count vs size
Dynamic view analysis
Existence checking
Large tables
Foreign keys
Understanding AR memory impact
Batches
Calculations
Bulk operations
Basic database scaling
Erlang analysis review
DB tips
How binary tree indexes actually work
EXPLAIN ANALYZE
Connection poolers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment