~/talk

The Humble Hash

Talkat RubyConf 2020 · 2020-11-17..11-19· [ruby]
slides:none on file

Two implementations of Conway’s Game of Life show a concrete win: replacing recursive recomputation with a hash with default_proc caches generations and keeps the simulation interactive while the plain method version stalls; similar memoization turns a fib(35) from ~30 million calls into 69 cached lookups. A real bugfix at scale swaps an O(disclaimers × providers) scan (300 × 500 → 150,000 checks) for a set-backed provider lookup (≈800 checks). Also demos memoization hash cache and Ruby’s abbrev/set patterns.

AI-written summary · about

  1. 0:00Introduction
  2. 5:13Basics
  3. 7:33Set
  4. 10:42Hash Example
  5. 14:34Default Values
  6. 24:46Abbrev Library
  7. 24:59Abbrev Library Overview
  8. 25:33Implementation
  9. 26:57Condensed Code
  10. 27:49Totals
  11. 29:37Memoization
  12. 30:52Summary
  13. 31:29Outro
~/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.