~/talk

How to fit a million stars into an iPhone

Talkat Mobius 2018 Piter · 2018-04-20..04-21· [web-performance]
links:none on file
slides:none on file

Shows how a 208‑byte star record becomes 56 bytes and a 560MB catalog falls to ~130MB by: replacing optionals with sentinel values and getters, switching to smaller integer types, moving small fields first to eliminate alignment gaps, and deduplicating strings into a dictionary with 16‑bit indices. Uses MemoryLayout.size/stride and profiling to guide changes, keeps unit tests to catch regressions, and ships the result as a SceneKit/ARKit viewer plus a server API that runs within a 500MB free tier. packed struct ordering string dictionary with 16‑bit indices MemoryLayout.stride checks

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:27Why optimize code
  3. 3:55Cache misses and performance
  4. 7:29Memory optimization basics
  5. 13:58The optimization loop
  6. 16:29Demo of star database app
  7. 17:55Problem with large star database
  8. 19:22Measuring struct memory size
  9. 21:10Analyzing star struct layout
  10. 23:38Replacing optionals with raw values
  11. 27:55Memory alignment and padding
  12. 30:42Reordering struct fields for efficiency
  13. 32:27Domain knowledge and string optimization
  14. 35:42Balancing memory and CPU usage
  15. 37:13Final optimization results
  16. 37:57When to apply these optimizations
  17. 39:22Optimizing Xcode compile times
  18. 42:18Server-side Swift benefits
  19. 43:00Key takeaways and conclusion
  20. 46:14Q&A
~/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.