~/talk

C++ Function Multiversioning in Windows

Talkat CppCon 2022 · 2022-09-11..09-16· [web-performance]
links:none on file
links:none on file
slides:none on file

Claim: compiler and Windows 11 loader collaborate to pick the best implementation at load time by embedding metadata and a BDD that fixes up direct calls so there is no per-call branch test or indirect-call CFI cost. Tooling: Visual C++ emits an msvc dispatch attribute and LTFS sections, linker builds a BDD and a thunk page, loader applies fixups at page fault. Numbers: memset/memcpy show up to 2x throughput differences; a prototype arm64 memcpy is ~20–30% faster and CFG overhead drops by roughly half in some benchmarks. Requires OS and toolchain support and uses thunks to avoid paging and container-density costs.

AI-written summary · about

  1. 0:00Introduction
  2. 0:39Problem Space
  3. 2:22Indirect Calls
  4. 5:57State Initialization
  5. 6:54GCC IFUNK
  6. 8:02iPhone Approach
  7. 9:24Load Time Function Selection
  8. 9:57Building Blocks
  9. 10:58OS Capabilities
  10. 12:46Binary Metadata
  11. 14:29Binary Decision Diagram BDD
  12. 16:00Other Building Blocks
  13. 16:23Ordered Set of Criteria
  14. 19:29How qualifiers work
  15. 21:02Examples
  16. 24:32Qualifiers
  17. 26:05Ordered Map
  18. 27:52Combine
  19. 28:40Syntax
  20. 31:23OS Support
  21. 32:16Tool Chain Details
  22. 33:33Compiler Modifications
  23. 35:03Expressions
  24. 35:40Const Expert
  25. 36:21Dispatch Attributed Functions
  26. 37:01Symbol Table
  27. 37:42LTFS Map
  28. 38:21Linker
  29. 40:39Arm64 Direct Calls
  30. 41:46Topological Bdd
  31. 43:21Relocation Type
  32. 43:50Thunk Page
  33. 44:49Fixups
  34. 47:21Thunks
  35. 48:46HyperV Containers
  36. 51:03Demo
  37. 53:28Performance
  38. 54:24Performance on Intel
  39. 56:54Performance on ARM
  40. 59:00Control Flowguard
~/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.