~/talk

Allocating Less: Really Thin Rust Cloud Apps

Talkat RustLab 2021 · 2021-03-18..09-23· [rust]
name:Evan Chan
links:none on file
slides:none on file

Rust can cut allocations to make tiny cloud units: a Vec is three 8-byte fields (24 bytes), a slice is 16 bytes, and a HashMap entry can cost up to ~72 bytes of overhead per key/value. Use concrete tactics: change signatures to borrow or accept IntoIterator, prefer smallvec / smallstring / nested to coalesce allocations, replace Boxed trait objects with enum_dispatch, swap allocators and profile with dhat (one case shows ~90% of allocations from a single serde_json path).

AI-written summary · about

  1. 0:00Start
  2. 3:28Why Thin Cloud Apps?
  3. 5:24Why Rust for Thin Cloud Apps?
  4. 7:57Rust Memory Model: Safety
  5. 8:20Details - Vec, String
  6. 9:33What about HashMaps?
  7. 11:15Where You're Allocating in your Apps
  8. 12:20Benchmarking Memory Usage
  9. 14:55Borrow, don't Move
  10. 16:55Flattening Data Structures
  11. 18:42Reducing clone with Async
  12. 21:08How slow is Arc, really?
  13. 21:56Avoiding Trait Objects with Enums
  14. 23:51(No) Serialization
  15. 26:56A JSON Processing Example
  16. 27:50JSON Processing - serde-json
  17. 28:58JeMalloc and MiMalloc
  18. 30:08Comparison using JSON benchmark
  19. 30:36Bump, Arena Allocators
  20. 31:28Minimizing Binary Size
  21. 32:04Thank You Very Much!
~/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.