~/talk

We implement cache together

Talkat f(by) 2020 · on Saturday, 2020-01-25· [scala, web-performance]
links:none on file
slides:none on file

Pure functional local cache implemented in Scala that returns effects (an IO-based API) and uses Ref (CAS-backed atomic state) wrapped around immutable Maps, then splits state into partitioned refs (one per shard) to remove a single-point contention. Get-or-load stores deferred load placeholders so concurrent misses attach to one in-flight load instead of duplicating work. Demo shows typical production patterns (10k hits with two misses saved ~200 ms); implementation is partial but working.

AI-written summary · about

  1. 0:00Introduction to caching
  2. 2:40Disclaimer and goals
  3. 3:26Defining cache API
  4. 6:22Building a mutable cache
  5. 7:56Moving to functional cache
  6. 9:24Introducing Ref for shared state
  7. 11:56How Ref works under the hood
  8. 16:42Implementing getOrLoad method
  9. 18:35Performance drawbacks of single Ref
  10. 21:09Partitioning cache to reduce contention
  11. 27:00Problem with parallel cache loading
  12. 30:44Using deferred values to prevent duplicate loads
  13. 34:18Summary and further improvements
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.