~/talk

New Ruby 2.1 Awesomeness: Pro Object Allocation Tracing

Talkat MountainWest RubyConf 2014 · 2014-03-20..03-21· [ruby]
slides:none on file

Ruby 2.1 exposes ObjectSpace.#trace_object_allocations so code reports file line class and method for each allocation; two gems allocation_stats and rack-objspace-stats aggregate and group those sites, support trace_object_allocations start/stop, burn-one and times=10 runs, and an interactive JSON view. Examples: dumping two strings into YAML shows 38 strings from visitor and 12 arrays; a tiny Rails 3.2 page expects ~100 strings but reports 756 strings; fixes include concat instead of +=, freezing or memoizing literals, and middleware output that pinpoints hot lines.

AI-written summary · about

  1. 0:00Intro
  2. 1:29Object Allocation Tracing
  3. 3:38Why are we doing this
  4. 4:29Aggregation
  5. 11:52Rack Allocation Stats
  6. 16:12How to allocate less
  7. 17:17String Freeze
  8. 19:52Rails Allocation
  9. 24:32Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.