Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sam Saffron / Jeff Atwood - Measuring Ruby - Discourse/StackOverflow
- - Always be measuring (don't be "playing it blind")
- - Dtrace/Stap
- - Added in Ruby 2.0
- - Using Dtrace call samplers to track method invocation counts
- - rbtrace
- - like strace but for ruby
- - very awesome
- - manual patching for instrumentation
- - old school
- - precise/clean
- - rack-mini-profiler
- - demo (see conference video)
- - in depth debugging information for rack requests (SQL tracing, intermethod timing analysis)
- - memory_profiler support for ruby-head (flamegraphs as well)
- - flamegraphs are much more accurate now, more samples per runtime slice
- - embedded callstack sampler in T*S_2
- - exception performance is poor (0.3 ms per exception) non-local transfer of controls are slow -- rack-mini-profiler shows these
- - require is expensive as well, 0.66 ms per require
- - improving dev speed
- - traditional fix is to enable asset bundling in Dev, this compromises the dev experience
- - why is this happening?
- - assets are validated after a full middleware crawl
- - etag calculation
- - ....
- - at discourse, shortcircuit this process w/ custom middleware (code in preso)
- - memory and ruby
- - in ruby head, memory profiler is new
- - CoW friendly GC lowers memory overhead
- - running benchmarks
- - continuously and with new hooks it's much easier to implement
- - what can you do?
- - audit memory usage
- - run rack_mini_profiler to integrate performance metrics into dev and production
- - Use flamegraphs to find your slowest code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement