~/talk

Faster, Easier, Simpler Vectors

Talkat CppCon 2021 · on Tuesday, 2021-10-26· at 14:00· online· [web-performance]
links:none on file
slides:none on file

Argues that std::vector can be replaced for many workloads and shows concrete implementations: 32‑bit vector, static vector, small‑buffer and stable vector that use virtual memory overcommit. Introduces primitives like append_from_capacity and uninitialized_relocate_no_overlap, a lazy‑pushback pattern, and reserve growth strategy. Provides a 145‑line reference implementation in the GitHub repo, inspects compiler‑generated assembly with Compiler Explorer, and reports small (1–5%) wins on typical sizes but up to ~30% worse for huge inputs when allocator/ABI tradeoffs aren’t tuned.

AI-written summary · about

  1. 0:00Introduction
  2. 1:36Outline
  3. 3:04Who am I
  4. 5:24Design Approach
  5. 6:54Vectors
  6. 10:40Vector Interface
  7. 12:36Copy Assignment
  8. 15:37Initializer List
  9. 19:13Allocators
  10. 22:25Live Demo
  11. 23:32Lazy Pushback
  12. 24:20Guaranteed Copy Illusion
  13. 25:20Generic Programming
  14. 26:15Pushback
  15. 30:39Move vs relocate
  16. 32:06trivial relocation
  17. 34:52trivial relocatable
  18. 37:40allocation
  19. 39:37assembly output
  20. 43:18static vector
  21. 46:50use cases
  22. 54:26programming language
~/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.